sqs

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AWSKey    string
	AWSSecret string
	AWSRegion string

	// Poll from this SQS URL
	URL string

	// Maximum number of time to attempt AWS service connection
	MaxRetries int

	// Maximum number of messages to retrieve per batch
	BatchSize int64

	// The maximum poll time (0 <= 20)
	WaitSeconds int64

	// Once a message is received by a consumer, the maximum time in seconds till others can see this
	VisibilityTimeout int64

	// Poll only once and exit
	RunOnce bool

	// Poll every X seconds defined by this value
	RunInterval int

	// Maximum number of handlers to spawn for batch processing
	MaxHandlers int

	// BusyTimeout in seconds
	BusyTimeout int
	// contains filtered or unexported fields
}

Config Wrapper for Config methods

func NewSQS

func NewSQS(opts Config) (*Config, error)

NewSQS Instantiate a SQS instance

func (*Config) ChangeVisibilityTimeout added in v0.2.1

func (s *Config) ChangeVisibilityTimeout(msg *sqs.Message, seconds int64) bool

ChangeVisibilityTimeout : Method to change visibility timeout of a message.

func (*Config) Delete

func (s *Config) Delete(msg *sqs.Message) error

Delete a SQS message from the queue

func (*Config) Enqueue

func (s *Config) Enqueue(msgBatch []*sqs.SendMessageBatchRequestEntry) error

Enqueue messages to SQS

func (*Config) Poll

func (s *Config) Poll()

Poll for messages in the queue

func (*Config) RegisterPollHandler added in v0.2.1

func (s *Config) RegisterPollHandler(pollHandler func(msg *sqs.Message))

RegisterPollHandler : A method to register a custom Poll Handling method

type SQS

type SQS interface {
	Poll()
	Delete(msg *sqs.Message) error
	Enqueue(msgBatch []*sqs.SendMessageBatchRequestEntry) error
	RegisterPollHandler(pollHandler func(msg *sqs.Message))
	ChangeVisibilityTimeout(msg *sqs.Message, seconds int64) bool
}

SQS An interface for SQS operations

Jump to

Keyboard shortcuts

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