sqs

package
v0.0.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderMessageID A unique identifier for the message. A MessageId is considered unique across all
	// Amazon Web Services accounts for an extended period of time.
	HeaderMessageID = "sqs-message-id"
	// HeaderMessageAttributesMD5 An MD5 digest of the non-URL-encoded message attribute string. You can use this
	// attribute to verify that Amazon SQS received the message correctly. Amazon SQS
	// URL-decodes the message before creating the MD5 digest. For information about
	// MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt) .
	HeaderMessageAttributesMD5 = "sqs-message-attributes-md5"
	// HeaderMessageReceiptHandle An identifier associated with the act of receiving the message. A new receipt
	// handle is returned every time you receive a message. When deleting a message,
	// you provide the last received receipt handle to delete the message.
	HeaderMessageReceiptHandle = "sqs-message-receipt-handle"
	// HeaderMessageBodyMD5 An MD5 digest of the non-URL-encoded message body string.
	HeaderMessageBodyMD5 = "sqs-message-body-md5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is the Amazon Simple Queue Service (SQS) streams.Reader implementation.

func NewReader

func NewReader(cfg ReaderConfig, awsCfg aws.Config, client *sqs.Client) Reader

NewReader allocates an Amazon Simple Queue Service (SQS) concrete implementation of streams.Reader.

func (Reader) Read

func (r Reader) Read(ctx context.Context, task streams.ReadTask) (err error)

type ReaderConfig

type ReaderConfig struct {
	amazon.Config
	Logger              *log.Logger   // Logging instance preferably with log level at <<info>>.
	ErrorLogger         *log.Logger   // Logging instance preferably with log level at <<error>>.
	MaxMessagesPerPoll  int32         // Maximum number of message for each polling process (up to 10).
	InFlightInterval    time.Duration // Total time a polling worker will lock a polled message batch, making this batch unavailable to other parallel workers.
	PollParkingDuration time.Duration // Maximum duration for a polling worker to wait for messages.
	PollInterval        time.Duration // Total time the polling worker scheduler will wait between each polling process.
	HandlerTimeout      time.Duration // Maximum duration for message handler processes (streams.ReaderHandleFunc).
}

ReaderConfig is the Amazon SQS reader configuration schema.

type Writer

type Writer struct {
	amazon.Writer
	// contains filtered or unexported fields
}

Writer is the Amazon Simple Queue Service (SQS) streams.Writer implementation.

func NewWriter

func NewWriter(cfg WriterConfig, awsCfg aws.Config, client *sqs.Client) Writer

NewWriter allocates an Amazon Simple Queue Service (SQS) concrete implementation of streams.Writer.

type WriterConfig

type WriterConfig struct {
	amazon.Config
	// The length of time, in seconds, for which a specific message is delayed. Valid
	// values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds
	// value become available for processing after the delay period is finished. If you
	// don't specify a value, the default value for the queue is applied. When you set
	// FifoQueue , you can't set DelaySeconds per message. You can set this parameter
	// only on a queue level.
	DelaySeconds int32
}

WriterConfig is the configuration schema for Amazon SQS streams.Writer implementation.

Jump to

Keyboard shortcuts

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