sqs

package
v1.206.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SQSMessageOnS3Key = "message-on-s3"

Variables

This section is empty.

Functions

func NewSQSClient

func NewSQSClient(awsRegion string) (*sqs.SQS, error)

NewSQSClient constructs a Messenger which sends messages to an SQS queue awsRegion - region that the queue was created awsQueue - name of the queue Note: Calling code needs SQS IAM permissions

func RetrieveMessageFromS3

func RetrieveMessageFromS3(session *s3.SessionWithHelpers, bucket string, filename string) ([]byte, error)

func SendSQSMessage

func SendSQSMessage(msgr Messenger, objectToSend interface{}, currentRequestID *string, sqsType string, isDebug bool) error

Types

type Messenger

type Messenger struct {
	QueueName          string
	QueueURL           string
	Region             string
	S3Session          *s3.SessionWithHelpers
	S3BucketName       string
	MessageGroupID     *string
	DelaySeconds       *int64
	RequestIDHeaderKey string
}

Messenger sends an arbitrary message via SQS

func (*Messenger) SendSQSMessage

func (m *Messenger) SendSQSMessage(headers map[string]string, body string, currentRequestID *string, sqsType string) (string, error)

SendSQSMessage sends a message to the queue associated with the messenger headers - string message attributes of the SQS message (see AWS SQS documentation) body - body of the SQS message (see AWS SQS documentation)

Jump to

Keyboard shortcuts

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