queue

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 14 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 {
	QueueArn  string `mapstructure:"queue_arn"`
	QueueName string `mapstructure:"queue_name"`
	Endpoint  string `mapstructure:"endpoint"`
	WaitTime  int64  `mapstructure:"wait_time"`
	Timeout   int64  `mapstructure:"timeout"`
	Enabled   bool   `mapstructure:"enabled"`
}

Config holds the required sqs config information.

type MessageProcessor

type MessageProcessor func(context.Context, []byte) error

MessageProcessor process a message.

type SQSConsumer

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

SQSConsumer reads and consumes sqs messages.

func NewConsumer

func NewConsumer(c Config, log log.Logger, processor MessageProcessor) (*SQSConsumer, error)

NewConsumer creates and initializes an SQSConsumer

func (*SQSConsumer) ProcessMessages

func (s *SQSConsumer) ProcessMessages(ctx context.Context)

ProcessMessages reads messages from a SQS queue and sends them to the MessageProcessor.

Jump to

Keyboard shortcuts

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