Documentation ¶
Index ¶
- Constants
- type Logger
- type SQSClient
- func (s *SQSClient) GetQueueUrl() *string
- func (s *SQSClient) GetQueues(prefix string) []*string
- func (s *SQSClient) Poll()
- func (s *SQSClient) ProcessMessage(sqsMessage *sqs.Message, queueUrl string)
- func (s *SQSClient) ReceiveMessages(queueUrl string, ch chan *sqs.Message) error
- func (s *SQSClient) SetLogger(logger Logger)
- func (s *SQSClient) Start()
- type SQSClientInterface
- type SQSClientOptions
- type SQSService
Constants ¶
View Source
const ( DefaultMaxNumberOfMessages = 10 DefaultVisibilityTimeout = 30 DefaultWaitTimeSeconds = 20 DefaultRegion = "us-east-1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQSClient ¶
type SQSClient struct { Client SQSService ClientOptions *SQSClientOptions Logger Logger }
func New ¶
func New(sqsService SQSService, options SQSClientOptions) *SQSClient
func (*SQSClient) GetQueueUrl ¶
GetQueueUrl returns the URL of the queue based on the queue name
func (*SQSClient) ProcessMessage ¶
ProcessMessage deletes or changes the visibility of the message based on the Handle function return.
func (*SQSClient) ReceiveMessages ¶
ReceiveMessages polls messages from the queue
type SQSClientInterface ¶
type SQSClientOptions ¶
type SQSClientOptions struct { QueueName string // Handle is the function that will be called when a message is received. // Return true if you want to delete the message from the queue, otherwise, return false Handle func(message *message.Message) bool Region string Endpoint string // PrefixBased is a flag that indicates if the queue name is a prefix PrefixBased bool MaxNumberOfMessages int64 VisibilityTimeout int64 WaitTimeSeconds int64 LogLevel string }
type SQSService ¶
type SQSService interface { GetQueueUrl(input *sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error) ReceiveMessage(input *sqs.ReceiveMessageInput) (*sqs.ReceiveMessageOutput, error) ChangeMessageVisibility(input *sqs.ChangeMessageVisibilityInput) (*sqs.ChangeMessageVisibilityOutput, error) DeleteMessage(input *sqs.DeleteMessageInput) (*sqs.DeleteMessageOutput, error) ListQueues(input *sqs.ListQueuesInput) (*sqs.ListQueuesOutput, error) }
Click to show internal directories.
Click to hide internal directories.