queue

package
v1.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMessages

func DeleteMessages(q *sqs.SQS, queueUrl string, deleteRequests []*sqs.SQSDeleteMessageRequest, timeoutDuration ...time.Duration) (failList []*sqs.SQSFailResult, err error)

DeleteMessages will delete one or more messages defined in deleteRequests, if any delete failures, failed deletions will be returned via failList

func GetQueue

func GetQueue(q *sqs.SQS, queueName string, messageRetentionSeconds uint, snsTopicArn string, timeoutDuration ...time.Duration) (queueUrl string, queueArn string, err error)

GetQueue will retrieve queueUrl and queueArn based on queueName, if queue is not found, a new queue will be created with the given queueName snsTopicArn = optional, set sns topic arn if needing to allow sns topic to send message to this newly created sqs

func NewQueueAdapter

func NewQueueAdapter(awsRegion awsregion.AWSRegion, httpOptions *awshttp2.HttpClientSettings) (*sqs.SQS, error)

NewQueueAdapter creates a new sqs queue service provider, and auto connect for use

func ReceiveMessages

func ReceiveMessages(q *sqs.SQS, queueUrl string, messageAttributeFilters []string, timeoutDuration ...time.Duration) (messageList []*sqs.SQSReceivedMessage, err error)

ReceiveMessages will attempt to receive up to 10 messages from given queueUrl

func SendMessage

func SendMessage(q *sqs.SQS, queueUrl string, messageBody string, messageAttributes map[string]*awssqs.MessageAttributeValue, timeoutDuration ...time.Duration) (messageId string, err error)

SendMessage will send a message to given queue

func SendMessageFIFO added in v1.7.0

func SendMessageFIFO(
	q *sqs.SQS,
	queueUrl string,
	messageBody string,
	messageGroupId string,
	messageDeduplicationId string,
	messageAttributes map[string]*awssqs.MessageAttributeValue,
	timeoutDuration ...time.Duration,
) (messageId string, err error)

FIFO-aware helper that supplies MessageGroupId / MessageDeduplicationId

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL