Documentation
¶
Overview ¶
Package sqs provides an in-memory mock implementation of AWS Simple Queue Service.
Index ¶
- type LambdaTrigger
- type Mock
- func (m *Mock) ChangeVisibility(_ context.Context, queueURL, receiptHandle string, timeout int) error
- func (m *Mock) CreateQueue(_ context.Context, cfg driver.QueueConfig) (*driver.QueueInfo, error)
- func (m *Mock) DeleteMessage(_ context.Context, queueURL, receiptHandle string) error
- func (m *Mock) DeleteQueue(_ context.Context, url string) error
- func (m *Mock) GetQueueInfo(_ context.Context, url string) (*driver.QueueInfo, error)
- func (m *Mock) ListQueues(_ context.Context, prefix string) ([]driver.QueueInfo, error)
- func (m *Mock) ReceiveMessages(_ context.Context, input driver.ReceiveMessageInput) ([]driver.Message, error)
- func (m *Mock) RemoveTrigger(queueURL string)
- func (m *Mock) SendMessage(_ context.Context, input driver.SendMessageInput) (*driver.SendMessageOutput, error)
- func (m *Mock) SetTrigger(queueURL string, fn LambdaTrigger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LambdaTrigger ¶
LambdaTrigger is a function that gets called when a message is sent to a queue.
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the AWS SQS service.
func (*Mock) ChangeVisibility ¶
func (m *Mock) ChangeVisibility(_ context.Context, queueURL, receiptHandle string, timeout int) error
ChangeVisibility changes the visibility timeout of a message in the specified queue.
func (*Mock) CreateQueue ¶
CreateQueue creates a new SQS queue.
func (*Mock) DeleteMessage ¶
DeleteMessage deletes a message from the specified queue using its receipt handle.
func (*Mock) DeleteQueue ¶
DeleteQueue deletes an SQS queue by URL.
func (*Mock) GetQueueInfo ¶
GetQueueInfo retrieves information about an SQS queue by URL.
func (*Mock) ListQueues ¶
ListQueues returns all queues whose names match the given prefix. If prefix is empty, all queues are returned.
func (*Mock) ReceiveMessages ¶
func (m *Mock) ReceiveMessages(_ context.Context, input driver.ReceiveMessageInput) ([]driver.Message, error)
ReceiveMessages receives messages from the specified SQS queue. Returns messages where VisibleAt <= now, and sets a new VisibleAt based on the visibility timeout.
func (*Mock) RemoveTrigger ¶
RemoveTrigger removes a Lambda trigger from a queue.
func (*Mock) SendMessage ¶
func (m *Mock) SendMessage(_ context.Context, input driver.SendMessageInput) (*driver.SendMessageOutput, error)
SendMessage sends a message to the specified SQS queue.
func (*Mock) SetTrigger ¶
func (m *Mock) SetTrigger(queueURL string, fn LambdaTrigger)
SetTrigger registers a Lambda trigger for a queue. When a message is sent to the queue, the trigger function is called automatically.