aws

package
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DataTypeNumber represents the Number datatype, use it when creating custom attributes
	DataTypeNumber = DataType("Number")
	// DataTypeString represents the String datatype, use it when creating custom attributes
	DataTypeString = DataType("String")
)

Variables

This section is empty.

Functions

func LoadAWSConfig

func LoadAWSConfig(ctx context.Context, cfg *ClientConfig, c *aws.CredentialsCache) (aCfg aws.Config, err error)

LoadAWSConfig loads aws config

Types

type ClientConfig

type ClientConfig struct {
	Config *Config
	// used to determine how many attempts exponential backoff should use before logging an error
	RetryCount int
}

ClientConfig defines the loafer aws configuration

func ValidateConfig

func ValidateConfig(cfg *ClientConfig) (*ClientConfig, error)

ValidateConfig validates client config fields

type Config

type Config struct {
	// private key to access aws
	Key string
	// secret to access aws
	Secret string
	// region for aws and used for determining the region
	Region string
	// profile for aws and used for determining the profile
	Profile string
	// provided automatically by aws, but must be set for emulators or local testing
	Hostname string

	// Add custom attributes to the message. This might be a correlationId or client meta information
	// custom attributes will be viewable on the sqs dashboard as metadata
	Attributes []CustomAttribute
}

Config defines the loafer aws configuration

func (*Config) NewCustomAttribute

func (c *Config) NewCustomAttribute(dataType DataType, title string, value interface{}) error

NewCustomAttribute adds a custom attribute to SNS and SQS messages. This can include correlationIds, logIds, or any additional information you would like separate from the payload body. These attributes can be easily seen from the SQS console.

must use sqs.DataTypeNumber of sqs.DataTypeString for the datatype, the value must match the type provided

type CustomAttribute

type CustomAttribute struct {
	Title string
	// Use sqs.DataTypeNumber or sqs.DataTypeString
	DataType string
	// Value represents the value
	Value string
}

CustomAttribute add custom attributes to SNS and SQS messages. This can include correlationIds, or any additional information you would like separate from the payload body. These attributes can be easily seen from the SQS console.

type DataType

type DataType string

DataType is an alias to string

func (DataType) String

func (dt DataType) String() string

String returns DataType as a string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL