Documentation ¶
Overview ¶
Package sqs is for messaging with AWS SQS.
Index ¶
- Variables
- func Cancelled(err error) bool
- func IsNoMessagesError(err error) bool
- type Raw
- type SQS
- func (s *SQS) CheckQueue(queueUrl string) error
- func (s *SQS) CreateQueue(queueName string, isFifoQueue bool) (string, error)
- func (s *SQS) Delete(queueURL, receiptHandle string) error
- func (s *SQS) DeleteQueue(queueUrl string) error
- func (s *SQS) GetQueueARN(url string) (string, error)
- func (s *SQS) GetQueueUrl(name string) (string, error)
- func (s *SQS) Ready() bool
- func (s *SQS) Receive(queueURL string, visibilityTimeout int32) (Raw, error)
- func (s *SQS) ReceiveWithAttributes(queueURL string, visibilityTimeout int32, attrs []types.QueueAttributeName) (Raw, error)
- func (s *SQS) ReceiveWithContext(ctx context.Context, queueURL string, visibilityTimeout int32) (Raw, error)
- func (s *SQS) ReceiveWithContextAttributes(ctx context.Context, queueURL string, visibilityTimeout int32, ...) (Raw, error)
- func (s *SQS) Send(queueURL string, body string) error
- func (s *SQS) SendBatch(ctx context.Context, queueURL string, bodies []string) error
- func (s *SQS) SendFifoMessage(queue, group, dedupe string, msg []byte) (string, error)
- func (s *SQS) SendNBatch(ctx context.Context, queueURL string, bodies []string) error
- func (s *SQS) SendWithDelay(queueURL string, body string, delay int32) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoMessages = errors.New("no messages received from queue")
specific error to return when no messages are received from the queue
Functions ¶
func IsNoMessagesError ¶
Types ¶
type SQS ¶
type SQS struct {
// contains filtered or unexported fields
}
func New ¶
New returns an SQS struct which wraps an SQS client using the default AWS credentials chain. This consults (in order) environment vars, config files, EC2 and ECS roles. It is an error if the AWS_REGION environment variable is not set. Requests with recoverable errors will be retried with the default retrier.
func NewWithMaxRetries ¶
NewWithMaxRetries returns the same as New(), but with the back off set to up to maxRetries times.
func (*SQS) CheckQueue ¶
CheckQueue checks if the given SQS queue exists and is accessible.
func (*SQS) CreateQueue ¶
CreateQueue creates an Amazon SQS queue with the specified name. You can specify whether the queue is created as a FIFO queue. Returns the queue URL.
func (*SQS) DeleteQueue ¶
DeleteQueue deletes an Amazon SQS queue.
func (*SQS) GetQueueUrl ¶
GetQueueUrl returns an AWS SQS queue URL given its name.
func (*SQS) Receive ¶
Receive receives a raw message or error from the queue. After a successful receive the message will be in flight until it is either deleted or the visibility timeout expires (at which point it is available for redelivery).
Applications should be able to handle duplicate or out of order messages, and should back off on Receive error.
func (*SQS) ReceiveWithAttributes ¶
func (s *SQS) ReceiveWithAttributes(queueURL string, visibilityTimeout int32, attrs []types.QueueAttributeName) (Raw, error)
ReceiveWithAttributes is the same as Receive except that Queue Attributes can be requested to be received with the message.
func (*SQS) ReceiveWithContext ¶
func (s *SQS) ReceiveWithContext(ctx context.Context, queueURL string, visibilityTimeout int32) (Raw, error)
receive with context so that system stop signal can be received, to receive system stop signal, register the context with signal.NotifyContext before passing in this function, when system stop signal is received, an error with message '... context canceled' will be returned which can be used to safely stop the system
func (*SQS) ReceiveWithContextAttributes ¶
func (s *SQS) ReceiveWithContextAttributes(ctx context.Context, queueURL string, visibilityTimeout int32, attrs []types.QueueAttributeName) (Raw, error)
ReceiveWithContextAttributes by context and Queue Attributes, so that system stop signal can be received by the context. to receive system stop signal, register the context with signal.NotifyContext before passing in this function, when system stop signal is received, an error with message '... context canceled' will be returned which can be used to safely stop the system
func (*SQS) SendFifoMessage ¶
SendFifoMessage puts a message onto the given AWS SQS queue.