sqs

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sqs is a thin wrapper over the AWS SQS SDK for the consumers that poll a queue (currently the inbound-email bridge). It exposes long-poll receive + delete and nothing else.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the AWS SQS SDK client bound to a single queue URL.

func NewClient

func NewClient(ctx context.Context, region, queueURL string) (*Client, *apierror.APIError)

NewClient creates an SQS client for the given region, bound to queueURL.

IMDS is disabled for the same reason as the S3 client: pods get credentials via IRSA (or static keys in dev), never the node instance role, and leaving IMDS in the chain blocks credential resolution for the full deadline on every call.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, receiptHandle string) *apierror.APIError

Delete acknowledges a message so it is not redelivered.

func (*Client) Receive

func (c *Client) Receive(ctx context.Context, maxMessages, waitSeconds int32) ([]Message, *apierror.APIError)

Receive long-polls the queue for up to maxMessages, waiting up to waitSeconds for a message.

type Message

type Message struct {
	Body          string
	ReceiptHandle string
}

Message is a received SQS message: its body plus the receipt handle needed to delete it.

type Queue

type Queue interface {
	Receive(ctx context.Context, maxMessages, waitSeconds int32) ([]Message, *apierror.APIError)
	Delete(ctx context.Context, receiptHandle string) *apierror.APIError
}

Queue defines the SQS operations the consumers need. An interface so consumers can be unit-tested against a fake.

Jump to

Keyboard shortcuts

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