sqsx

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeMsgVisibilityTimeout

func ChangeMsgVisibilityTimeout(ctx context.Context, cli sqsiface.SQSAPI, url string, receiptHandle *string, visibilityTimeout int64) (*sqs.ChangeMessageVisibilityOutput, error)

ChangeMsgVisibilityTimeout change visibility timeout of a message in the specified queue

func DeleteMessage

func DeleteMessage(ctx context.Context, receiptHandle *string, cli sqsiface.SQSAPI, url string) error

DeleteMessage deletes a message from SQS queue

func GetQueueURL

func GetQueueURL(ctx context.Context, cli sqsiface.SQSAPI, queue *string) (string, error)

GetQueueURL returns the URL of an existing queue. This action provides a simple way to retrieve the URL of an Amazon SQS queue

func ReceiveMessage

func ReceiveMessage(ctx context.Context, cli sqsiface.SQSAPI, url string, opts ...Option) (*sqs.Message, error)

ReceiveMessage get a message from the queue

func SendFIFOMessage

func SendFIFOMessage(ctx context.Context, cli sqsiface.SQSAPI, url string, body string, group string, deduplicationID string) (*sqs.SendMessageOutput, error)

SendFIFOMessage delivers a message to the specified FIFO queue

func SendMessage

func SendMessage(ctx context.Context, cli sqsiface.SQSAPI, url string, body string) (*sqs.SendMessageOutput, error)

SendMessage delivers a message to the specified queue

func Watch

func Watch(ctx context.Context, cli sqsiface.SQSAPI, url string, f OnMessage, e OnError, opts ...Option)

Watch watches a queue a call the callback function on messages or errors

func WatchRunner

func WatchRunner(cli sqsiface.SQSAPI, url string, f OnMessage, e OnError) contextx.Runner

WatchRunner returns a runner that watch a queue, using the runner's context

Types

type OnError

type OnError func(error)

OnError is the type that errors callback function must satisfy

type OnMessage

type OnMessage func(msg *sqs.Message) error

OnMessage is the type that callback functions must satisfy

type Option

type Option func(*options)

func WithVisibilityTimeout

func WithVisibilityTimeout(d time.Duration) Option

func WithWaitTime

func WithWaitTime(d time.Duration) Option

Jump to

Keyboard shortcuts

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