Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
MaxNumberOfMessage int64
QueueName string
QueueURL string
WaitTimeSecond int64
}
Config struct
type HandlerFunc ¶
HandlerFunc is used to define the Handler that is run on for each message
func (HandlerFunc) HandleMessage ¶
func (f HandlerFunc) HandleMessage(msg *sqs.Message) error
HandleMessage wraps a function for handling sqs messages
type InvalidEventError ¶
type InvalidEventError struct {
// contains filtered or unexported fields
}
InvalidEventError struct
func NewInvalidEventError ¶
func NewInvalidEventError(event, msg string) InvalidEventError
NewInvalidEventError creates InvalidEventError struct
func (InvalidEventError) Error ¶
func (e InvalidEventError) Error() string
type LoggerIFace ¶
type LoggerIFace interface {
Debug(i ...interface{})
Info(i ...interface{})
Error(i ...interface{})
}
LoggerIFace interface
type QueueAPI ¶
type QueueAPI interface {
GetQueueUrl(*sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error)
QueueDeleteReceiverAPI
}
QueueAPI interface is the minimum interface required from a queue implementation to invoke New worker. Invoking worker.New() takes in a queue name which is why GetQueueUrl is needed.
type QueueDeleteReceiverAPI ¶
type QueueDeleteReceiverAPI interface {
DeleteMessage(*sqs.DeleteMessageInput) (*sqs.DeleteMessageOutput, error)
ReceiveMessage(*sqs.ReceiveMessageInput) (*sqs.ReceiveMessageOutput, error)
}
QueueDeleteReceiverAPI interface is the minimum interface required to run a worker. When a worker is in its Receive loop, it requires this interface.
type Worker ¶
type Worker struct {
Config *Config
Log LoggerIFace
SqsClient QueueDeleteReceiverAPI
}
Worker struct
Click to show internal directories.
Click to hide internal directories.