consumer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMaxNumberOfMessages = int64(10)
	DefaultWaitTimeSeconds     = int64(5)
	DefaultConcurrency         = 1
	DefaultDeleteStrategy      = DeleteStrategyOnSuccess
)
View Source
var (
	DeleteStrategyImmediate = DeleteStrategy("IMMEDIATE")
	DeleteStrategyOnSuccess = DeleteStrategy("ON_SUCCESS")
)

Functions

This section is empty.

Types

type ConsumerBatchFn

type ConsumerBatchFn func(data [][]byte) error

type ConsumerFn

type ConsumerFn func(data []byte) error

type DataSource

type DataSource interface {
	Start(ctx context.Context, consumeFn ConsumerFn) error
}

type DeleteStrategy added in v0.1.1

type DeleteStrategy string

type SQS

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

func NewSQSConsumer

func NewSQSConsumer(conf *SQSConf, svc sqsiface.SQSAPI) (*SQS, error)

func (*SQS) Start

func (s *SQS) Start(ctx context.Context, consumeFn ConsumerFn) error

func (*SQS) StartBatched

func (s *SQS) StartBatched(ctx context.Context, batcher *batcher.Batcher, consumeFn ConsumerBatchFn) error

type SQSConf

type SQSConf struct {
	Queue               string
	Concurrency         int
	MaxNumberOfMessages int64
	VisibilityTimeout   int64
	WaitTimeSeconds     int64
	DeleteStrategy      DeleteStrategy
}

Jump to

Keyboard shortcuts

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