sqsworker

package
v0.0.0-...-c5563bb Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The maximum number of messages to return. Amazon SQS never returns more messages
	// than this value (however, fewer messages might be returned). Valid values
	// are 1 to 10. Default is 10.
	MaxNumberOfMessage int64 = 10
	// The duration (in seconds) for which the call waits for a message to arrive
	// in the queue before returning. If a message is available, the call returns
	// sooner than WaitTimeSeconds.
	WaitTimeSecond int64 = 20

	Log *logrus.Logger
)

Exported Variables

Functions

func NewSQSClient

func NewSQSClient(queueName string, cfgs ...*aws.Config) (*sqs.SQS, string)

NewSQSClient returns a SQS Client and a Queue URL for you you to connect to

func Start

func Start(svc *sqs.SQS, queueURL string, h Handler)

Start starts the polling and will continue polling till the application is forcibly stopped

Types

type Handler

type Handler interface {
	HandleMessage(msg *sqs.Message) error
}

Handler interface

type HandlerFunc

type HandlerFunc func(msg *sqs.Message) error

HandlerFunc is used to define the Handler that is run on for each message

func (HandlerFunc) HandleMessage

func (f HandlerFunc) HandleMessage(msg *sqs.Message) error

type InvalidEventError

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

func NewInvalidEventError

func NewInvalidEventError(event, msg string) InvalidEventError

func (InvalidEventError) Error

func (e InvalidEventError) Error() string

Jump to

Keyboard shortcuts

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