Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MaxNumberOfMessage int32 QueueName *string QueueURL *string WaitTimeSecond int32 }
Config struct
type HandlerFunc ¶
type HandlerFunc func(msg types.Message) HandlerFuncResponse
HandlerFunc is used to define the Handler that is run on for each message
type HandlerFuncResponse ¶
type HandlerFuncResponse struct { Status ResponseStatus VisibilityTimeout *int32 }
type LoggerIFace ¶
type LoggerIFace interface { Debug(i ...interface{}) Info(i ...interface{}) Warn(i ...interface{}) Error(i ...interface{}) }
LoggerIFace interface
type ResponseStatus ¶
type ResponseStatus string
const ( KeepMessage ResponseStatus = "KeepMessage" DeleteMessage ResponseStatus = "DeleteMessage" ChangeMessageVisibility ResponseStatus = "ChangeMessageVisibility" )
type SqsConsumeApi ¶
type SqsConsumeApi interface { GetQueueUrl(ctx context.Context, params *sqs.GetQueueUrlInput, optFns ...func(*sqs.Options)) (*sqs.GetQueueUrlOutput, error) ReceiveMessage(ctx context.Context, params *sqs.ReceiveMessageInput, optFns ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error) DeleteMessage(ctx context.Context, params *sqs.DeleteMessageInput, optFns ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error) ChangeMessageVisibility(ctx context.Context, params *sqs.ChangeMessageVisibilityInput, optFns ...func(*sqs.Options)) (*sqs.ChangeMessageVisibilityOutput, error) }
func CreateSqsClient ¶
func CreateSqsClient(awsConfig aws.Config) SqsConsumeApi
CreateSqsClient creates a client for SQS API
type Worker ¶
type Worker struct { Config *Config Log LoggerIFace SqsClient SqsConsumeApi }
Worker struct
func New ¶
func New(client SqsConsumeApi, config *Config, logger LoggerIFace) *Worker
New sets up a new Worker
Click to show internal directories.
Click to hide internal directories.