queue

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 9 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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