adapter

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 6 Imported by: 0

README

sqs-adapter

SQS Queue-Worker Library. See _example/.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType uint8
const (
	ActionTypeClosed ActionType
	ActionTypeReceivingMessage
	ActionTypeReceivedMessage
	ActionTypeChangingMessageVisibilityTimeout
	ActionTypeChangedMessageVisibilityTimeout
	ActionTypeDeletingMessage
	ActionTypeDeletedMessage
)

func (ActionType) MarshalJSON

func (a ActionType) MarshalJSON() ([]byte, error)

json.Marshaler

func (ActionType) String

func (a ActionType) String() string

fmt.Stringer

type Closed

type Closed struct{}

Closed signal

type Log

type Log any

Log value

type LogMessage

type LogMessage struct {
	ActionType ActionType `json:"action_type"`
	Detail     any        `json:"detail"`
}

LogMessage

func (LogMessage) String

func (msg LogMessage) String() string

fmt.Stringer

type ReceiveController

type ReceiveController interface {
	Run(context.Context, Worker) (<-chan Closed, <-chan Log)
}

ReceiveController

func NewReceiveController

func NewReceiveController(c *sqs.Client, cfg *ReceiveControllerConfig) ReceiveController

type ReceiveControllerConfig

type ReceiveControllerConfig struct {
	// QueueURL (required)
	QueueURL string
	// ReceiveOption (required)
	ReceiveOption ReceiveOption
}

type ReceiveOption

type ReceiveOption struct {
	// MaxNumberOfMessages (default: 1)
	MaxNumberOfMessages int32
	// VisibilityTimeout (default: 30s)
	VisibilityTimeout int32
	// WaitTimeSeconds (default: 20s)
	WaitTimeSeconds int32
	// DoChangeMessageVisibolity (default: false)
	DoChangeMessageVisibolity bool
	// ChangeMessageVisibilityAfter (default: 0)
	ChangeMessageVisibilityAfter time.Duration
}

func NewDefaultReceiveOption

func NewDefaultReceiveOption() ReceiveOption

type Worker

type Worker func(context.Context, types.Message) error

Worker

Jump to

Keyboard shortcuts

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