Documentation ¶
Index ¶
- type Mock
- func (sqs *Mock) CreateDefaultFifoQueue(queue string) (string, error)
- func (sqs *Mock) CreateDefaultQueue(queue string) (string, error)
- func (sqs *Mock) CreateQueue(queue string, retentionPeriod int, visibilityTimeout int, fifo bool, ...) (string, error)
- func (sqs *Mock) DeleteQueue(queue string) error
- func (sqs *Mock) GetQueue(queue string) *MockQueue
- func (sqs *Mock) ListQueues() ([]string, error)
- func (Mock) Ping() error
- func (sqs *Mock) PollQueue(queue string, callback func(string) bool, pollWaitTime int, ...) error
- func (sqs *Mock) PollQueueWithRetry(queue string, callback func(string) bool, pollWaitTime int, ...) error
- func (sqs *Mock) SendMessage(message string, queue string) error
- func (sqs *Mock) Wait(numRetries int, minBackOff int, maxBackOff int) (Sqs, error)
- type MockQueue
- type Service
- func (mq *Service) CreateDefaultFifoQueue(queue string) (string, error)
- func (mq *Service) CreateDefaultQueue(queue string) (string, error)
- func (mq *Service) CreateQueue(queue string, retentionPeriod int, visibilityTimeout int, fifo bool, ...) (string, error)
- func (mq *Service) DeleteQueue(queue string) error
- func (mq *Service) ListQueues() ([]string, error)
- func (mq *Service) Ping() error
- func (mq *Service) PollQueue(queue string, callback func(string) bool, pollWaitTime int, ...) error
- func (mq *Service) PollQueueWithRetry(queue string, callback func(string) bool, pollWaitTime int, ...) error
- func (mq *Service) SendMessage(message string, queue string) error
- func (mq *Service) Wait(numRetries int, minBackOff int, maxBackOff int) (Sqs, error)
- type Sqs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
func (*Mock) CreateDefaultFifoQueue ¶
func (*Mock) CreateQueue ¶
func (*Mock) DeleteQueue ¶
func (*Mock) ListQueues ¶
func (*Mock) PollQueueWithRetry ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateDefaultFifoQueue ¶
func (*Service) CreateDefaultQueue ¶
func (*Service) CreateQueue ¶
func (mq *Service) CreateQueue(queue string, retentionPeriod int, visibilityTimeout int, fifo bool, encrypted bool) (string, error)
- Retention period: time the messages will remain in the queue if not deleted
- VisibilityTimeout: time the message will be hidden from other consumers after it is retried from the queue. If this time expires it will be assumed that the message was not processed successfully and will be available to other consumers for retry.
- Fifo: whether the queue should be first in first out with deliver once guarantee
- encrypted: whether the queue should use server side encryption using the default kms
func (*Service) DeleteQueue ¶
func (*Service) ListQueues ¶
func (*Service) PollQueue ¶
func (mq *Service) PollQueue(queue string, callback func(string) bool, pollWaitTime int, maxNumberOfMessagesPerPoll int) error
Polls the queue for new messages
- queue: the name of the queue to poll
- callback: the function that will be called to process each message. If the function returns true the message will be deleted from the queue
- pollWaitTime: the amount of time in seconds sqs will wait for a message on a queue. As soon as a message is received the function will return (regardless of the wait time) and a new request started.
- maxNumberOfMessagesPerPoll: the max number of messages (between 1 and 10) that can be returned from a single poll.
func (*Service) PollQueueWithRetry ¶
type Sqs ¶
type Sqs interface { Ping() error Wait(numRetries int, minBackOff int, maxBackOff int) (Sqs, error) SendMessage(message string, queue string) error PollQueue(queue string, callback func(string) bool, pollWaitTime int, maxNumberOfMessagesPerPoll int) error PollQueueWithRetry(queue string, callback func(string) bool, pollWaitTime int, maxNumberOfMessagesPerPoll int, numRetries int, minBackOff int, maxBackOff int) error CreateQueue(queue string, retentionPeriod int, visibilityTimeout int, fifo bool, encrypted bool) (string, error) CreateDefaultQueue(queue string) (string, error) CreateDefaultFifoQueue(queue string) (string, error) DeleteQueue(queue string) error ListQueues() ([]string, error) }
func SetEndPoint ¶
Click to show internal directories.
Click to hide internal directories.