Documentation ¶
Overview ¶
Package sqs provides a basic FIFO client for AWS SQS (Amazon Simple Queue Service).
Index ¶
Constants ¶
const ( // DefaultWaitTimeSeconds is the default duration (in seconds) for which the call waits for a message to arrive in the queue before returning. // This must be between 0 and 20 seconds. DefaultWaitTimeSeconds = 20 // DefaultVisibilityTimeout is the default duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. DefaultVisibilityTimeout = 600 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for the SQS client in the AWS SDK.
func (*Client) Receive ¶
Receive retrieves a message from the queue. This function will wait up to WaitTimeSeconds seconds for a message to be available, otherwise it will return an empty message. Once retrieved, a message will not be visible for up to VisibilityTimeout seconds. Once processed the message should be removed from the queue by calling the Delete method.
type Message ¶
type Message struct { // can contain: JSON, XML, plain text. Body string // contains filtered or unexported fields }
Message represents a message in the queue.
type Option ¶
type Option func(*cfg)
Option is a type to allow setting custom client options.
func WithAWSOption ¶ added in v1.23.0
func WithAWSOption(opt func(*config.LoadOptions) error) Option
WithAWSOption allows to add an arbitrary AWS option.
func WithEndpoint ¶
WithEndpoint overrides the AWS endpoint for the service.
func WithRegion ¶ added in v1.24.0
WithRegion allows to specify the AWS region.
func WithRegionFromURL ¶ added in v1.24.2
WithRegionFromURL allows to specify the AWS region extracted from the provided URL.
func WithVisibilityTimeout ¶
WithVisibilityTimeout overrides the default duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. Values range: 0 to 43200. Maximum: 12 hours.
func WithWaitTimeSeconds ¶
WithWaitTimeSeconds overrides the default duration (in seconds) for which the call waits for a message to arrive in the queue before returning. Values range: 0 to 20 seconds.
type SQS ¶
type SQS interface { SendMessage(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, 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) }
SQS represents the mockable functions in the AWS SDK SQS client.