Documentation ¶
Index ¶
Constants ¶
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 ¶
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.