sqs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body = map[string]string

type Message

type Message struct {
	Body          Body
	ReceiptHandle string
}

type NewQueueOptions

type NewQueueOptions struct {
	Config   aws.Config
	Name     string
	WaitTime time.Duration
}

type Queue

type Queue struct {
	Client *sqs.Client
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(opts NewQueueOptions) *Queue

func (*Queue) Delete

func (q *Queue) Delete(ctx context.Context, m *Message) error

Delete a Message. Does nothing if the passed Message is nil.

func (*Queue) Receive

func (q *Queue) Receive(ctx context.Context) (*Message, error)

Receive a Message. Returns nil if no message is available.

func (*Queue) Send

func (q *Queue) Send(ctx context.Context, b Body) error

Send a message body as JSON.

func (*Queue) SetTimeout

func (q *Queue) SetTimeout(ctx context.Context, m *Message, timeout time.Duration) error

SetTimeout sets the visibility timeout for the Message, overwriting any existing timeout. The timeout is set from now. Does nothing if the Message is nil.

Jump to

Keyboard shortcuts

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