sqs

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 37 Imported by: 0

README

SQS

Parity grade: A · SDK aws-sdk-go-v2/service/sqs@v1.45.0 · last audited 2026-07-11 (3d4de4f9)

Coverage

Metric Value
Operations audited 18 (13 ok, 1 partial, 4 other)
Feature families 11 (8 ok, 1 partial, 2 other)
Known gaps 3
Deferred items 2
Resource leaks clean
Known gaps
  • FifoThroughputLimit=perQueue (AWS default) is not rate-limited at all; only perMessageGroupId is. (bd: gopherstack-qgh)
  • sns_delivery.go's internal SendMessage calls for SNS->SQS fan-out and DLQ redirect never pass a Region, so a subscribed queue in a non-default region is unreachable via SNS delivery. (bd: gopherstack-qgh)
  • KMS SSE (SqsManagedSseEnabled/KmsMasterKeyId/KmsDataKeyReusePeriodSeconds) are accepted, range/shape-validated, and round-trip through GetQueueAttributes, but no actual encryption is modeled (expected for this class of emulator; would require cross-service KMS integration — out of scope for services/sqs/).
Deferred
  • SDK-driven integration tests (test/integration/*_parity_test.go) were not run this pass — per parity-principles.md, unit tests are not full parity proof. Recommend a follow-up integration-suite pass.
  • This pass: aws-sdk-go-v2/service/sqs bumped 1.44.2 -> 1.45.0 between audits (dependency-upgrade commit, not an sqs-specific change); diffed the two module versions and confirmed no operation/shape changes (only CHANGELOG/generated.json/go_module_metadata.go and new auto-generated serde_snapshot fixtures differ), so no new API surface to audit. Also reviewed the backend.go/persistence.go migration of b.queues/b.moveTasks from bare maps to the new pkgs/store.Table[V] generic collection (shared pkg, out of scope to edit here): locking discipline is preserved (Table performs no internal locking by design; every call site still holds b.mu exactly as it did with the bare map), Snapshot/Restore round-trip through a throwaway DTO registry rather than the live table (correctly excludes non-serialisable fields and RUNNING move tasks), and DLQ pointer re-wiring after Restore iterates the now-populated table correctly. No bugs found in the refactor itself.

More

Documentation

Index

Constants

View Source
const (

	// AttrApproxMessages is the SQS attribute name for approximate number of visible messages.
	AttrApproxMessages = "ApproximateNumberOfMessages"
	// AttrApproxMessagesNotVisible is the SQS attribute name for messages currently in flight.
	AttrApproxMessagesNotVisible = "ApproximateNumberOfMessagesNotVisible"
)
View Source
const NoVisibilityTimeout = -1

NoVisibilityTimeout is the sentinel value for ReceiveMessageInput.VisibilityTimeout meaning "the caller did not specify a VisibilityTimeout" — the queue's own VisibilityTimeout attribute should be used instead. This is exported (rather than relying on the Go zero value) because 0 is itself a legitimate, AWS-documented VisibilityTimeout value (make the message immediately visible to other consumers again), so the struct's int zero value cannot double as "unspecified" without silently truncating every unset caller's intended default visibility window down to zero. Any Go-level caller of InMemoryBackend.ReceiveMessage that wants the queue's configured default — including cross-service integrations and tests — must set VisibilityTimeout: sqs.NoVisibilityTimeout explicitly; leaving the field at its Go zero value requests an explicit 0-second visibility timeout instead.

Variables

View Source
var (
	ErrQueueNotFound            = awserr.New("AWS.SimpleQueueService.NonExistentQueue", awserr.ErrNotFound)
	ErrQueueAlreadyExists       = awserr.New("QueueAlreadyExists", awserr.ErrAlreadyExists)
	ErrInvalidAttribute         = errors.New("InvalidAttributeValue")
	ErrInvalidBatchEntry        = errors.New("AWS.SimpleQueueService.EmptyBatchRequest")
	ErrReceiptHandleInvalid     = errors.New("ReceiptHandleIsInvalid")
	ErrMessageNotInflight       = errors.New("MessageNotInflight")
	ErrTooManyEntriesInBatch    = errors.New("AWS.SimpleQueueService.TooManyEntriesInBatchRequest")
	ErrBatchEntryIDsNotDistinct = errors.New("AWS.SimpleQueueService.BatchEntryIdsNotDistinct")
	ErrUnknownAction            = errors.New("InvalidAction")
	ErrMessageTooLarge          = errors.New("MessageTooLarge")
	ErrInvalidWaitTime          = errors.New("InvalidParameterValue")
	ErrInvalidVisibilityTimeout = errors.New("InvalidParameterValue.VisibilityTimeout")
	ErrMissingMessageGroupID    = errors.New("InvalidParameterValue.MissingMessageGroupID")
	ErrMissingDeduplicationID   = errors.New("InvalidParameterValue.MissingDeduplicationID")
	ErrTaskHandleInvalid        = errors.New("InvalidParameterValue.TaskHandle")
	ErrInvalidPermissionLabel   = errors.New("InvalidParameterValue.PermissionLabel")
	ErrMoveTaskAlreadyRunning   = errors.New("ResourceInConflict.MoveTaskAlreadyRunning")
	// ErrMoveTaskNotRunning is returned by CancelMessageMoveTask when the referenced
	// task exists but is not in RUNNING or CANCELLING status.
	ErrMoveTaskNotRunning = errors.New("ResourceInConflict.MoveTaskNotRunning")
	// ErrInvalidPermissionActions is returned by AddPermission when Actions is empty.
	ErrInvalidPermissionActions = errors.New("InvalidParameterValue.PermissionActions")
	// ErrInvalidPermissionAccountIDs is returned by AddPermission when AWSAccountIDs is empty.
	ErrInvalidPermissionAccountIDs = errors.New("InvalidParameterValue.PermissionAccountIDs")
	// ErrInvalidSourceArn is returned by StartMessageMoveTask when SourceArn is empty or invalid.
	ErrInvalidSourceArn = errors.New("InvalidParameterValue.SourceArn")
	// ErrInvalidMaxMessagesPerSecond is returned by StartMessageMoveTask when
	// MaxNumberOfMessagesPerSecond is negative.
	ErrInvalidMaxMessagesPerSecond = errors.New("InvalidParameterValue.MaxNumberOfMessagesPerSecond")
	// ErrInvalidDelaySeconds is returned by SendMessage when DelaySeconds is out of range (0-900).
	ErrInvalidDelaySeconds = errors.New("InvalidParameterValue.DelaySeconds")
	// ErrInvalidQueueName is returned when a queue name does not conform to AWS naming rules.
	ErrInvalidQueueName = errors.New("InvalidParameterValue.QueueName")
	// ErrInvalidMessageBody is returned when the message body is empty.
	ErrInvalidMessageBody = errors.New("InvalidParameterValue.MessageBody")
	// ErrInvalidMaxMessages is returned when MaxNumberOfMessages is outside [1, 10].
	ErrInvalidMaxMessages = errors.New("InvalidParameterValue.MaxNumberOfMessages")
	// ErrPurgeQueueInProgress is returned when PurgeQueue is called within 60s of a previous purge.
	ErrPurgeQueueInProgress = errors.New("AWS.SimpleQueueService.PurgeQueueInProgress")
	// ErrOverLimit is returned when an operation would exceed an AWS-imposed quota
	// (e.g. too many in-flight messages, too many permissions, too many queues).
	ErrOverLimit = errors.New("OverLimit")
	// ErrBatchRequestTooLong is returned when SendMessageBatch's combined payload
	// (bodies + attribute names/types/values) exceeds the per-batch byte limit
	// (matches the per-queue MaximumMessageSize, default 256 KiB).
	ErrBatchRequestTooLong = errors.New("AWS.SimpleQueueService.BatchRequestTooLong")
	// ErrInvalidMessageAttributeValue is returned when a message attribute has an
	// invalid DataType or its value does not match the declared type.
	ErrInvalidMessageAttributeValue = errors.New("InvalidParameterValue.MessageAttribute")
	// ErrInvalidAttributeName is returned when SetQueueAttributes attempts to
	// change an immutable attribute such as FifoQueue.
	ErrInvalidAttributeName = errors.New("InvalidAttributeName")
	// ErrFIFODelayNotSupported is returned when a SendMessage or batch entry for
	// a FIFO queue specifies a non-zero DelaySeconds (FIFO queues do not support
	// per-message delays).
	ErrFIFODelayNotSupported = errors.New("InvalidParameterValue.FIFODelaySeconds")
)

Sentinel errors for SQS operations.

View Source
var ErrNilAppContext = errors.New("sqs: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AddPermissionInput

type AddPermissionInput struct {
	QueueURL      string
	Region        string
	Label         string
	Actions       []string
	AWSAccountIDs []string
}

AddPermissionInput is the input for AddPermission.

type BatchErrorEntry

type BatchErrorEntry struct {
	ID          string `xml:"Id"`
	Code        string `xml:"Code"`
	Message     string `xml:"Message"`
	SenderFault bool   `xml:"SenderFault"`
}

BatchErrorEntry is a failed batch result entry.

type BatchResultEntry

type BatchResultEntry struct {
	ID string `xml:"Id"`
}

BatchResultEntry is a successful batch result entry.

type BatchResultErrorEntry

type BatchResultErrorEntry struct {
	ID          string
	Code        string
	Message     string
	SenderFault bool
}

BatchResultErrorEntry is a failed entry in a batch result.

type CancelMessageMoveTaskInput

type CancelMessageMoveTaskInput struct {
	TaskHandle string
}

CancelMessageMoveTaskInput is the input for CancelMessageMoveTask.

type CancelMessageMoveTaskOutput

type CancelMessageMoveTaskOutput struct {
	ApproximateNumberOfMessagesMoved int64
}

CancelMessageMoveTaskOutput is the output for CancelMessageMoveTask.

type ChangeMessageVisibilityBatchInput

type ChangeMessageVisibilityBatchInput struct {
	QueueURL string
	Region   string
	Entries  []ChangeMessageVisibilityBatchRequestEntry
}

ChangeMessageVisibilityBatchInput holds input for ChangeMessageVisibilityBatch.

type ChangeMessageVisibilityBatchOutput

type ChangeMessageVisibilityBatchOutput struct {
	Successful []BatchResultEntry
	Failed     []BatchErrorEntry
}

ChangeMessageVisibilityBatchOutput holds the result of ChangeMessageVisibilityBatch.

type ChangeMessageVisibilityBatchRequestEntry

type ChangeMessageVisibilityBatchRequestEntry struct {
	ID                string
	ReceiptHandle     string
	VisibilityTimeout int
}

ChangeMessageVisibilityBatchRequestEntry is one item in a batch visibility change.

type ChangeMessageVisibilityBatchResponse

type ChangeMessageVisibilityBatchResponse struct {
	XMLName          xml.Name                           `xml:"ChangeMessageVisibilityBatchResponse"`
	ResponseMetadata XMLResponseMetadata                `xml:"ResponseMetadata"`
	Xmlns            string                             `xml:"xmlns,attr"`
	Result           ChangeMessageVisibilityBatchResult `xml:"ChangeMessageVisibilityBatchResult"`
}

ChangeMessageVisibilityBatchResponse is the XML envelope.

type ChangeMessageVisibilityBatchResult

type ChangeMessageVisibilityBatchResult struct {
	Successful []BatchResultEntry `xml:"ChangeMessageVisibilityBatchResultEntry"`
	Failed     []BatchErrorEntry  `xml:"BatchResultErrorEntry"`
}

ChangeMessageVisibilityBatchResult is the XML body.

type ChangeMessageVisibilityInput

type ChangeMessageVisibilityInput struct {
	QueueURL          string
	Region            string
	ReceiptHandle     string
	VisibilityTimeout int
}

ChangeMessageVisibilityInput is the input for ChangeMessageVisibility.

type ChangeMessageVisibilityResponse

type ChangeMessageVisibilityResponse struct {
	XMLName          xml.Name            `xml:"ChangeMessageVisibilityResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

ChangeMessageVisibilityResponse is the XML response for ChangeMessageVisibility.

type CreateQueueInput

type CreateQueueInput struct {
	Attributes map[string]string
	Tags       map[string]string
	QueueName  string
	Endpoint   string
	// Scheme is the URL scheme ("http" or "https") to use when constructing
	// the queue URL. Defaults to "http" when empty for backwards
	// compatibility, but callers should pass "https" when the request was
	// served over TLS so the returned QueueURL matches AWS conventions.
	Scheme string
	// Region is the AWS region for ARN construction (optional; defaults to backend region).
	Region string
}

CreateQueueInput is the input for CreateQueue.

type CreateQueueOutput

type CreateQueueOutput struct {
	QueueURL string
}

CreateQueueOutput is the output for CreateQueue.

type CreateQueueResponse

type CreateQueueResponse struct {
	XMLName           xml.Name            `xml:"CreateQueueResponse"`
	CreateQueueResult CreateQueueResult   `xml:"CreateQueueResult"`
	ResponseMetadata  XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns             string              `xml:"xmlns,attr"`
}

CreateQueueResponse is the XML response for CreateQueue.

type CreateQueueResult

type CreateQueueResult struct {
	QueueURL string `xml:"QueueUrl"`
}

CreateQueueResult holds the result of a CreateQueue operation.

type DeleteMessageBatchEntry

type DeleteMessageBatchEntry struct {
	ID            string
	ReceiptHandle string
}

DeleteMessageBatchEntry is a single entry in a DeleteMessageBatch request.

type DeleteMessageBatchInput

type DeleteMessageBatchInput struct {
	QueueURL string
	Region   string
	Entries  []DeleteMessageBatchEntry
}

DeleteMessageBatchInput is the input for DeleteMessageBatch.

type DeleteMessageBatchOutput

type DeleteMessageBatchOutput struct {
	Successful []DeleteMessageBatchResultEntry
	Failed     []BatchResultErrorEntry
}

DeleteMessageBatchOutput is the output for DeleteMessageBatch.

type DeleteMessageBatchResponse

type DeleteMessageBatchResponse struct {
	XMLName                  xml.Name                    `xml:"DeleteMessageBatchResponse"`
	ResponseMetadata         XMLResponseMetadata         `xml:"ResponseMetadata"`
	Xmlns                    string                      `xml:"xmlns,attr"`
	DeleteMessageBatchResult XMLDeleteMessageBatchResult `xml:"DeleteMessageBatchResult"`
}

DeleteMessageBatchResponse is the XML response for DeleteMessageBatch.

type DeleteMessageBatchResultEntry

type DeleteMessageBatchResultEntry struct {
	ID string
}

DeleteMessageBatchResultEntry is a successful entry in a DeleteMessageBatch result.

type DeleteMessageInput

type DeleteMessageInput struct {
	QueueURL      string
	Region        string
	ReceiptHandle string
}

DeleteMessageInput is the input for DeleteMessage.

type DeleteMessageResponse

type DeleteMessageResponse struct {
	XMLName          xml.Name            `xml:"DeleteMessageResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

DeleteMessageResponse is the XML response for DeleteMessage.

type DeleteQueueInput

type DeleteQueueInput struct {
	QueueURL string
	Region   string
}

DeleteQueueInput is the input for DeleteQueue.

type DeleteQueueResponse

type DeleteQueueResponse struct {
	XMLName          xml.Name            `xml:"DeleteQueueResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

DeleteQueueResponse is the XML response for DeleteQueue.

type GetQueueAttributesInput

type GetQueueAttributesInput struct {
	QueueURL       string
	Region         string
	AttributeNames []string
}

GetQueueAttributesInput is the input for GetQueueAttributes.

type GetQueueAttributesOutput

type GetQueueAttributesOutput struct {
	Attributes map[string]string
}

GetQueueAttributesOutput is the output for GetQueueAttributes.

type GetQueueAttributesResponse

type GetQueueAttributesResponse struct {
	XMLName                  xml.Name                 `xml:"GetQueueAttributesResponse"`
	ResponseMetadata         XMLResponseMetadata      `xml:"ResponseMetadata"`
	Xmlns                    string                   `xml:"xmlns,attr"`
	GetQueueAttributesResult GetQueueAttributesResult `xml:"GetQueueAttributesResult"`
}

GetQueueAttributesResponse is the XML response for GetQueueAttributes.

type GetQueueAttributesResult

type GetQueueAttributesResult struct {
	Attributes []XMLAttribute `xml:"Attribute"`
}

GetQueueAttributesResult holds the result of a GetQueueAttributes operation.

type GetQueueURLInput

type GetQueueURLInput struct {
	QueueName string
	Region    string
}

GetQueueURLInput is the input for GetQueueURL.

type GetQueueURLOutput

type GetQueueURLOutput struct {
	QueueURL string
}

GetQueueURLOutput is the output for GetQueueURL.

type GetQueueURLResponse

type GetQueueURLResponse struct {
	XMLName           xml.Name            `xml:"GetQueueUrlResponse"`
	GetQueueURLResult GetQueueURLResult   `xml:"GetQueueUrlResult"`
	ResponseMetadata  XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns             string              `xml:"xmlns,attr"`
}

GetQueueURLResponse is the XML response for GetQueueUrl.

type GetQueueURLResult

type GetQueueURLResult struct {
	QueueURL string `xml:"QueueUrl"`
}

GetQueueURLResult holds the result of a GetQueueUrl operation.

type Handler

type Handler struct {
	Backend StorageBackend

	Endpoint      string
	DefaultRegion string
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for SQS operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new SQS Handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this SQS instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the SQS action from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the queue name from the JSON request body's QueueUrl field.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported SQS operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for SQS operations. It supports both the JSON protocol (X-Amz-Target) and the legacy Query (form-encoded) protocol.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for the SQS handler.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Purge

func (h *Handler) Purge(ctx context.Context, cutoff time.Time)

Purge implements service.Purgeable by delegating to the backend structure if supported.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches incoming SQS requests. It accepts two request styles:

  1. JSON protocol: POST with X-Amz-Target: AmazonSQS.<Action>
  2. Query protocol: POST with Content-Type: application/x-www-form-urlencoded and a recognised Action= body parameter

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the janitor worker and waits for it to exit.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker starts the background janitor if it is configured.

func (*Handler) WithJanitor

func (h *Handler) WithJanitor(interval ...time.Duration) *Handler

WithJanitor attaches a background janitor to the handler. It stops the backend's auto-started internal janitor so the two do not run concurrently and race on the shared lock.

type InFlightMessage

type InFlightMessage struct {
	VisibleAt     time.Time `json:"visibleAt"`
	Msg           *Message  `json:"msg"`
	ReceiptHandle string    `json:"receiptHandle"`
	// Generation matches the Queue.receiveGeneration at the time of receive.
	// Used to detect stale receipt handles when a message is re-received after
	// a visibility timeout expires and the generation counter advances.
	Generation uint64 `json:"generation"`
}

InFlightMessage wraps a message that has been received but not deleted.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using in-memory maps.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new empty InMemoryBackend with default account/region and a background service context.

func NewInMemoryBackendWithConfig

func NewInMemoryBackendWithConfig(accountID, region string) *InMemoryBackend

NewInMemoryBackendWithConfig creates a new InMemoryBackend with the given account ID and region and a background service context.

func NewInMemoryBackendWithContext

func NewInMemoryBackendWithContext(svcCtx context.Context, accountID, region string) *InMemoryBackend

NewInMemoryBackendWithContext creates a new InMemoryBackend whose background goroutines are bounded by svcCtx. If svcCtx is nil, context.Background is used.

func (*InMemoryBackend) AddPermission

func (b *InMemoryBackend) AddPermission(input *AddPermissionInput) error

AddPermission adds a permission statement to the specified queue.

func (*InMemoryBackend) CancelMessageMoveTask

func (b *InMemoryBackend) CancelMessageMoveTask(
	input *CancelMessageMoveTaskInput,
) (*CancelMessageMoveTaskOutput, error)

CancelMessageMoveTask cancels an active message move task. Returns ErrMoveTaskNotRunning if the task is not in RUNNING or CANCELLING state, matching AWS behaviour ("A message move task with the specified task handle is not running.").

func (*InMemoryBackend) ChangeMessageVisibility

func (b *InMemoryBackend) ChangeMessageVisibility(input *ChangeMessageVisibilityInput) error

ChangeMessageVisibility updates the visibility timeout for an in-flight message.

func (*InMemoryBackend) ChangeMessageVisibilityBatch

func (b *InMemoryBackend) ChangeMessageVisibilityBatch(
	input *ChangeMessageVisibilityBatchInput,
) (*ChangeMessageVisibilityBatchOutput, error)

ChangeMessageVisibilityBatch updates visibility for a batch of in-flight messages.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops the background janitor goroutine and releases associated resources. It is safe to call Close multiple times; subsequent calls are no-ops. The backend must not be used after Close returns.

func (*InMemoryBackend) CreateQueue

func (b *InMemoryBackend) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error)

CreateQueue creates a new SQS queue.

func (*InMemoryBackend) DeleteMessage

func (b *InMemoryBackend) DeleteMessage(input *DeleteMessageInput) error

DeleteMessage removes an in-flight message by its receipt handle. Uses inFlightByHandle for O(1) lookup (#56) and per-queue lock (#55).

func (*InMemoryBackend) DeleteMessageBatch

func (b *InMemoryBackend) DeleteMessageBatch(
	input *DeleteMessageBatchInput,
) (*DeleteMessageBatchOutput, error)

DeleteMessageBatch deletes a batch of messages from the specified queue.

func (*InMemoryBackend) DeleteMessagesLocal

func (b *InMemoryBackend) DeleteMessagesLocal(queueURL string, receiptHandles []string) error

DeleteMessagesLocal is an internal method used by the ESM poller to delete successfully processed messages by their receipt handles.

func (*InMemoryBackend) DeleteQueue

func (b *InMemoryBackend) DeleteQueue(input *DeleteQueueInput) error

DeleteQueue removes a queue by its URL.

func (*InMemoryBackend) GetQueueAttributes

func (b *InMemoryBackend) GetQueueAttributes(
	input *GetQueueAttributesInput,
) (*GetQueueAttributesOutput, error)

GetQueueAttributes returns queue attributes, computing dynamic ones on the fly.

func (*InMemoryBackend) GetQueueURL

func (b *InMemoryBackend) GetQueueURL(input *GetQueueURLInput) (*GetQueueURLOutput, error)

GetQueueURL returns the URL for a queue by name in the requested region.

func (*InMemoryBackend) ListAll

func (b *InMemoryBackend) ListAll() []QueueInfo

ListAll returns a snapshot of all queues as QueueInfo values. The returned slice contains value copies of the immutable queue metadata, safe for concurrent use after the lock is released.

func (*InMemoryBackend) ListDeadLetterSourceQueues

func (b *InMemoryBackend) ListDeadLetterSourceQueues(
	input *ListDeadLetterSourceQueuesInput,
) (*ListDeadLetterSourceQueuesOutput, error)

ListDeadLetterSourceQueues returns the URLs of all queues that have the given queue configured as their dead-letter queue via a RedrivePolicy.

func (*InMemoryBackend) ListMessageMoveTasks

func (b *InMemoryBackend) ListMessageMoveTasks(
	input *ListMessageMoveTasksInput,
) (*ListMessageMoveTasksOutput, error)

ListMessageMoveTasks returns message move tasks for the given source ARN.

Per AWS semantics:

  • If MaxResults is 0 (not set), it defaults to 1 (the most recent task).
  • The maximum allowed value for MaxResults is 10.
  • Results are sorted newest-first (descending by startedAt timestamp).
  • TaskHandle is only populated for tasks in RUNNING status.

func (*InMemoryBackend) ListQueueTags

func (b *InMemoryBackend) ListQueueTags(input *ListQueueTagsInput) (*ListQueueTagsOutput, error)

ListQueueTags returns the tags for a queue.

func (*InMemoryBackend) ListQueues

func (b *InMemoryBackend) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error)

ListQueues returns queue URLs in the requested region, optionally filtered by prefix.

func (*InMemoryBackend) Purge

func (b *InMemoryBackend) Purge(ctx context.Context, cutoff time.Time)

Purge removes all queues created before the given cutoff time.

func (*InMemoryBackend) PurgeQueue

func (b *InMemoryBackend) PurgeQueue(input *PurgeQueueInput) error

PurgeQueue removes all messages from a queue without deleting it. AWS enforces a 60-second cooldown between PurgeQueue calls on the same queue.

func (*InMemoryBackend) ReceiveMessage

func (b *InMemoryBackend) ReceiveMessage(
	input *ReceiveMessageInput,
) (*ReceiveMessageOutput, error)

func (*InMemoryBackend) ReceiveMessagesLocal

func (b *InMemoryBackend) ReceiveMessagesLocal(
	queueURL string,
	maxMessages int,
) ([]*Message, error)

ReceiveMessagesLocal is an internal method used by the ESM poller to pull messages from a queue without long-polling. It returns up to maxMessages visible messages, moving them to in-flight state using the queue's default visibility timeout.

func (*InMemoryBackend) RemovePermission

func (b *InMemoryBackend) RemovePermission(input *RemovePermissionInput) error

RemovePermission removes a permission statement from the specified queue.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory state from the database. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development. The active SNS subscription listener is kept intact so that SNS→SQS delivery continues to work after a reset (wireSNSToSQS is only wired at startup and is not re-run after reset).

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable. DLQ pointers are re-wired after all queues are reconstructed by re-applying each queue's RedrivePolicy attribute.

func (*InMemoryBackend) SendMessage

func (b *InMemoryBackend) SendMessage(input *SendMessageInput) (*SendMessageOutput, error)

SendMessage adds a message to the specified queue.

func (*InMemoryBackend) SendMessageBatch

func (b *InMemoryBackend) SendMessageBatch(
	input *SendMessageBatchInput,
) (*SendMessageBatchOutput, error)

SendMessageBatch sends a batch of messages to the specified queue. Results in the Successful and Failed slices are returned in the same order as the corresponding entries in the input slice.

func (*InMemoryBackend) SetMetricEmitter

func (b *InMemoryBackend) SetMetricEmitter(e MetricEmitter)

SetMetricEmitter sets the emitter used to forward SQS operation metrics to CloudWatch.

func (*InMemoryBackend) SetQueueAttributes

func (b *InMemoryBackend) SetQueueAttributes(input *SetQueueAttributesInput) error

SetQueueAttributes updates attributes on an existing queue.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartMessageMoveTask

func (b *InMemoryBackend) StartMessageMoveTask(
	input *StartMessageMoveTaskInput,
) (*StartMessageMoveTaskOutput, error)

StartMessageMoveTask starts an asynchronous task that moves messages from the source queue (typically a DLQ) to the destination queue. If DestinationArn is empty, the backend looks for a queue whose RedrivePolicy points to the source ARN and uses that as the destination. Returns ErrMoveTaskAlreadyRunning if there is already a RUNNING task for the source ARN.

func (*InMemoryBackend) SubscribeToSNS

func (b *InMemoryBackend) SubscribeToSNS(emitter events.EventEmitter[*events.SNSPublishedEvent])

SubscribeToSNS registers a listener on the given SNS publish emitter so that every message published to an SNS topic with an "sqs" subscription is delivered to the matching in-memory queue.

Delivery is synchronous and best-effort: per-message errors are silently dropped so that a missing queue does not block other subscribers.

If SubscribeToSNS has been called before, the previous subscription is replaced by unsubscribing the old listener before registering the new one, preventing stale listeners from accumulating in the emitter on repeated calls.

func (*InMemoryBackend) TagQueue

func (b *InMemoryBackend) TagQueue(input *TagQueueInput) error

TagQueue adds or updates tags on a queue.

func (*InMemoryBackend) TagQueueByARN

func (b *InMemoryBackend) TagQueueByARN(queueARN string, newTags map[string]string) error

TagQueueByARN applies tags to the queue identified by its ARN. Returns ErrQueueNotFound if no queue with that ARN exists.

func (*InMemoryBackend) TaggedQueues

func (b *InMemoryBackend) TaggedQueues() []TaggedQueueInfo

TaggedQueues returns a snapshot of all queues with their ARNs and tags. Intended for use by the Resource Groups Tagging API provider.

func (*InMemoryBackend) UntagQueue

func (b *InMemoryBackend) UntagQueue(input *UntagQueueInput) error

UntagQueue removes tags from a queue.

func (*InMemoryBackend) UntagQueueByARN

func (b *InMemoryBackend) UntagQueueByARN(queueARN string, tagKeys []string) error

UntagQueueByARN removes the specified tag keys from the queue identified by its ARN. Returns ErrQueueNotFound if no queue with that ARN exists.

type InvalidParameterError

type InvalidParameterError struct {
	Message string
}

InvalidParameterError represents an InvalidParameterValue error with a dynamic message.

func (*InvalidParameterError) Error

func (e *InvalidParameterError) Error() string

type Janitor

type Janitor struct {
	Backend  *InMemoryBackend
	Interval time.Duration
}

Janitor is the SQS background worker that deletes messages that have exceeded their MessageRetentionPeriod.

func NewJanitor

func NewJanitor(backend *InMemoryBackend, interval time.Duration) *Janitor

NewJanitor creates a new SQS Janitor for the given backend.

func (*Janitor) Run

func (j *Janitor) Run(ctx context.Context)

Run runs the janitor loop until ctx is cancelled.

type ListDeadLetterSourceQueuesInput

type ListDeadLetterSourceQueuesInput struct {
	QueueURL   string
	Region     string
	NextToken  string
	MaxResults int
}

ListDeadLetterSourceQueuesInput is the input for ListDeadLetterSourceQueues.

type ListDeadLetterSourceQueuesOutput

type ListDeadLetterSourceQueuesOutput struct {
	NextToken string
	QueueURLs []string
}

ListDeadLetterSourceQueuesOutput holds the result of ListDeadLetterSourceQueues.

type ListMessageMoveTasksInput

type ListMessageMoveTasksInput struct {
	SourceArn  string
	MaxResults int32
}

ListMessageMoveTasksInput is the input for ListMessageMoveTasks.

type ListMessageMoveTasksOutput

type ListMessageMoveTasksOutput struct {
	Results []MessageMoveTask
}

ListMessageMoveTasksOutput is the output for ListMessageMoveTasks.

type ListQueueTagsInput

type ListQueueTagsInput struct {
	QueueURL string
	Region   string
}

ListQueueTagsInput holds the input for ListQueueTags.

type ListQueueTagsOutput

type ListQueueTagsOutput struct {
	Tags *tags.Tags
}

ListQueueTagsOutput holds the result of ListQueueTags.

type ListQueueTagsResponse

type ListQueueTagsResponse struct {
	XMLName          xml.Name            `xml:"ListQueueTagsResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
	Result           ListQueueTagsResult `xml:"ListQueueTagsResult"`
}

ListQueueTagsResponse is the XML envelope for ListQueueTags.

type ListQueueTagsResult

type ListQueueTagsResult struct {
	Tags []TagEntry `xml:"Tag"`
}

ListQueueTagsResult is the XML body for ListQueueTagsResponse.

type ListQueuesInput

type ListQueuesInput struct {
	QueueNamePrefix string
	NextToken       string
	Region          string
	MaxResults      int
}

ListQueuesInput is the input for ListQueues.

type ListQueuesOutput

type ListQueuesOutput struct {
	NextToken string
	QueueURLs []string
}

ListQueuesOutput is the output for ListQueues.

type ListQueuesResponse

type ListQueuesResponse struct {
	XMLName          xml.Name            `xml:"ListQueuesResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
	ListQueuesResult ListQueuesResult    `xml:"ListQueuesResult"`
}

ListQueuesResponse is the XML response for ListQueues.

type ListQueuesResult

type ListQueuesResult struct {
	NextToken string   `xml:"NextToken,omitempty"`
	QueueURLs []string `xml:"QueueUrl"`
}

ListQueuesResult holds the result of a ListQueues operation.

type Message

type Message struct {
	VisibleAt                    time.Time                        `json:"visibleAt,omitzero"`
	MessageAttributes            map[string]MessageAttributeValue `json:"messageAttributes,omitempty"`
	Attributes                   map[string]string                `json:"attributes,omitempty"`
	MessageDeduplicationID       string                           `json:"messageDeduplicationID,omitempty"`
	MessageGroupID               string                           `json:"messageGroupID,omitempty"`
	SequenceNumber               string                           `json:"sequenceNumber,omitempty"`
	MessageID                    string                           `json:"messageID"`
	ReceiptHandle                string                           `json:"receiptHandle"`
	MD5OfBody                    string                           `json:"md5OfBody"`
	MD5OfMessageAttributes       string                           `json:"md5OfMessageAttributes,omitempty"`
	MD5OfMessageSystemAttributes string                           `json:"md5OfMessageSystemAttributes,omitempty"`
	Body                         string                           `json:"body"`

	SentTimestamp                    int64 `json:"sentTimestamp"`
	ApproximateFirstReceiveTimestamp int64 `json:"approximateFirstReceiveTimestamp"`
	ApproximateReceiveCount          int   `json:"approximateReceiveCount"`
	// contains filtered or unexported fields
}

Message represents an SQS message.

type MessageAttributeValue

type MessageAttributeValue struct {
	DataType    string `json:"dataType"`
	StringValue string `json:"stringValue"`
	BinaryValue []byte `json:"binaryValue,omitempty"`
}

MessageAttributeValue holds a message attribute value.

type MessageMoveTask

type MessageMoveTask struct {
	// ApproximateNumberOfMessagesToMove is the total messages when the task started.
	// nil when not yet determined.
	ApproximateNumberOfMessagesToMove *int64
	// MaxNumberOfMessagesPerSecond is nil when no rate limit was set.
	MaxNumberOfMessagesPerSecond *int32
	// FailureReason is populated when Status is FAILED.
	FailureReason  *string
	TaskHandle     string
	SourceArn      string
	DestinationArn string
	Status         MoveTaskStatus
	// ApproximateNumberOfMessagesMoved is always present (not a pointer), matching
	// the AWS SDK ListMessageMoveTasksResultEntry.ApproximateNumberOfMessagesMoved.
	ApproximateNumberOfMessagesMoved int64
	// StartedTimestamp is always present (Unix epoch ms), matching the AWS SDK.
	StartedTimestamp int64
}

MessageMoveTask describes the state of a single message move task.

type MetricEmitter

type MetricEmitter interface {
	EmitMetric(namespace, name string, value float64, unit string) error
}

MetricEmitter emits a CloudWatch metric data point. It is implemented by the CloudWatch backend and injected into InMemoryBackend so that SQS operations can be forwarded to CloudWatch as metrics.

type MetricEmitterFunc

type MetricEmitterFunc func(namespace, name string, value float64, unit string) error

MetricEmitterFunc is a function adapter for MetricEmitter.

func (MetricEmitterFunc) EmitMetric

func (f MetricEmitterFunc) EmitMetric(namespace, name string, value float64, unit string) error

EmitMetric implements MetricEmitter.

type MoveTaskStatus

type MoveTaskStatus string

MoveTaskStatus represents the lifecycle state of a StartMessageMoveTask operation.

const (
	// MoveTaskStatusRunning indicates the task is actively moving messages.
	MoveTaskStatusRunning MoveTaskStatus = "RUNNING"
	// MoveTaskStatusCompleted indicates the task finished successfully.
	MoveTaskStatusCompleted MoveTaskStatus = "COMPLETED"
	// MoveTaskStatusCancelling indicates the task has been asked to cancel.
	MoveTaskStatusCancelling MoveTaskStatus = "CANCELLING"
	// MoveTaskStatusCancelled indicates the task was cancelled.
	MoveTaskStatusCancelled MoveTaskStatus = "CANCELLED"
	// MoveTaskStatusFailed indicates the task failed.
	MoveTaskStatusFailed MoveTaskStatus = "FAILED"
)

type Provider

type Provider struct{}

Provider implements service.Provider for the SQS service.

func (*Provider) Init

Init initializes the SQS service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type PurgeQueueInput

type PurgeQueueInput struct {
	QueueURL string
	Region   string
}

PurgeQueueInput is the input for PurgeQueue.

type PurgeQueueResponse

type PurgeQueueResponse struct {
	XMLName          xml.Name            `xml:"PurgeQueueResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

PurgeQueueResponse is the XML response for PurgeQueue.

type Queue

type Queue struct {
	Attributes  map[string]string
	Permissions map[string]*QueuePermissionEntry

	Tags             *tags.Tags
	DeduplicationIDs map[string]time.Time

	Name   string
	URL    string
	Region string

	MaxReceiveCount int

	IsFIFO bool
	// contains filtered or unexported fields
}

type QueueInfo

type QueueInfo struct {
	Name   string
	URL    string
	IsFIFO bool
}

QueueInfo holds the immutable-after-creation fields of a queue, returned by ListAll.

type QueuePermissionEntry

type QueuePermissionEntry struct {
	AWSAccountIDs []string `json:"awsAccountIDs"`
	Actions       []string `json:"actions"`
}

QueuePermissionEntry represents a single AddPermission statement on a queue.

type ReceiveMessageInput

type ReceiveMessageInput struct {
	QueueURL string
	Region   string
	// ReceiveRequestAttemptID enables FIFO exactly-once retry: repeating a receive
	// with the same ID within 5 minutes returns the original message set.
	ReceiveRequestAttemptID string
	AttributeNames          []string
	MessageAttributeNames   []string
	MaxNumberOfMessages     int
	VisibilityTimeout       int
	WaitTimeSeconds         int
}

ReceiveMessageInput is the input for ReceiveMessage.

type ReceiveMessageOutput

type ReceiveMessageOutput struct {
	Messages []*Message
}

ReceiveMessageOutput is the output for ReceiveMessage.

type ReceiveMessageResponse

type ReceiveMessageResponse struct {
	XMLName              xml.Name             `xml:"ReceiveMessageResponse"`
	ResponseMetadata     XMLResponseMetadata  `xml:"ResponseMetadata"`
	Xmlns                string               `xml:"xmlns,attr"`
	ReceiveMessageResult ReceiveMessageResult `xml:"ReceiveMessageResult"`
}

ReceiveMessageResponse is the XML response for ReceiveMessage.

type ReceiveMessageResult

type ReceiveMessageResult struct {
	Messages []XMLMessage `xml:"Message"`
}

ReceiveMessageResult holds the result of a ReceiveMessage operation.

type RemovePermissionInput

type RemovePermissionInput struct {
	QueueURL string
	Region   string
	Label    string
}

RemovePermissionInput is the input for RemovePermission.

type SendMessageBatchEntry

type SendMessageBatchEntry struct {
	MessageAttributes       map[string]MessageAttributeValue
	MessageSystemAttributes map[string]MessageAttributeValue
	ID                      string
	MessageBody             string
	MessageGroupID          string
	MessageDeduplicationID  string
	DelaySeconds            int
}

SendMessageBatchEntry is a single entry in a SendMessageBatch request.

type SendMessageBatchInput

type SendMessageBatchInput struct {
	QueueURL string
	Region   string
	Entries  []SendMessageBatchEntry
}

SendMessageBatchInput is the input for SendMessageBatch.

type SendMessageBatchOutput

type SendMessageBatchOutput struct {
	Successful []SendMessageBatchResultEntry
	Failed     []BatchResultErrorEntry
}

SendMessageBatchOutput is the output for SendMessageBatch.

type SendMessageBatchResponse

type SendMessageBatchResponse struct {
	XMLName                xml.Name                  `xml:"SendMessageBatchResponse"`
	ResponseMetadata       XMLResponseMetadata       `xml:"ResponseMetadata"`
	Xmlns                  string                    `xml:"xmlns,attr"`
	SendMessageBatchResult XMLSendMessageBatchResult `xml:"SendMessageBatchResult"`
}

SendMessageBatchResponse is the XML response for SendMessageBatch.

type SendMessageBatchResultEntry

type SendMessageBatchResultEntry struct {
	ID                           string
	MessageID                    string
	MD5OfBody                    string
	MD5OfMessageAttributes       string
	MD5OfMessageSystemAttributes string
	SequenceNumber               string
}

SendMessageBatchResultEntry is a successful entry in a SendMessageBatch result.

type SendMessageInput

type SendMessageInput struct {
	MessageAttributes map[string]MessageAttributeValue
	// MessageSystemAttributes carries reserved system attributes from the
	// caller (currently only AWSTraceHeader). They are stored on the message
	// and surfaced via ReceiveMessage when the consumer asks for them by name.
	MessageSystemAttributes map[string]MessageAttributeValue
	QueueURL                string
	Region                  string
	MessageBody             string
	MessageGroupID          string
	MessageDeduplicationID  string
	DelaySeconds            int
}

SendMessageInput is the input for SendMessage.

type SendMessageOutput

type SendMessageOutput struct {
	MessageID                    string
	MD5OfBody                    string
	MD5OfMessageAttributes       string
	MD5OfMessageSystemAttributes string
	SequenceNumber               string
}

SendMessageOutput is the output for SendMessage.

type SendMessageResponse

type SendMessageResponse struct {
	XMLName           xml.Name            `xml:"SendMessageResponse"`
	SendMessageResult SendMessageResult   `xml:"SendMessageResult"`
	ResponseMetadata  XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns             string              `xml:"xmlns,attr"`
}

SendMessageResponse is the XML response for SendMessage.

type SendMessageResult

type SendMessageResult struct {
	MD5OfMessageBody       string `xml:"MD5OfMessageBody"`
	MD5OfMessageAttributes string `xml:"MD5OfMessageAttributes,omitempty"`
	MessageID              string `xml:"MessageId"`
}

SendMessageResult holds the result of a SendMessage operation.

type SetQueueAttributesInput

type SetQueueAttributesInput struct {
	Attributes map[string]string
	QueueURL   string
	Region     string
}

SetQueueAttributesInput is the input for SetQueueAttributes.

type SetQueueAttributesResponse

type SetQueueAttributesResponse struct {
	XMLName          xml.Name            `xml:"SetQueueAttributesResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

SetQueueAttributesResponse is the XML response for SetQueueAttributes.

type Settings

type Settings struct{}

Settings holds service-level configuration for the SQS backend.

type StartMessageMoveTaskInput

type StartMessageMoveTaskInput struct {
	SourceArn                    string
	DestinationArn               string
	MaxNumberOfMessagesPerSecond int32
}

StartMessageMoveTaskInput is the input for StartMessageMoveTask.

type StartMessageMoveTaskOutput

type StartMessageMoveTaskOutput struct {
	TaskHandle string
}

StartMessageMoveTaskOutput is the output for StartMessageMoveTask.

type StorageBackend

type StorageBackend interface {
	CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error)
	DeleteQueue(input *DeleteQueueInput) error
	ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error)
	GetQueueURL(input *GetQueueURLInput) (*GetQueueURLOutput, error)
	GetQueueAttributes(input *GetQueueAttributesInput) (*GetQueueAttributesOutput, error)
	SetQueueAttributes(input *SetQueueAttributesInput) error
	SendMessage(input *SendMessageInput) (*SendMessageOutput, error)
	ReceiveMessage(input *ReceiveMessageInput) (*ReceiveMessageOutput, error)
	DeleteMessage(input *DeleteMessageInput) error
	ChangeMessageVisibility(input *ChangeMessageVisibilityInput) error
	SendMessageBatch(input *SendMessageBatchInput) (*SendMessageBatchOutput, error)
	DeleteMessageBatch(input *DeleteMessageBatchInput) (*DeleteMessageBatchOutput, error)
	PurgeQueue(input *PurgeQueueInput) error
	TagQueue(input *TagQueueInput) error
	UntagQueue(input *UntagQueueInput) error
	ListQueueTags(input *ListQueueTagsInput) (*ListQueueTagsOutput, error)
	ChangeMessageVisibilityBatch(
		input *ChangeMessageVisibilityBatchInput,
	) (*ChangeMessageVisibilityBatchOutput, error)
	ListDeadLetterSourceQueues(
		input *ListDeadLetterSourceQueuesInput,
	) (*ListDeadLetterSourceQueuesOutput, error)
	AddPermission(input *AddPermissionInput) error
	RemovePermission(input *RemovePermissionInput) error
	StartMessageMoveTask(input *StartMessageMoveTaskInput) (*StartMessageMoveTaskOutput, error)
	CancelMessageMoveTask(input *CancelMessageMoveTaskInput) (*CancelMessageMoveTaskOutput, error)
	ListMessageMoveTasks(input *ListMessageMoveTasksInput) (*ListMessageMoveTasksOutput, error)
	ListAll() []QueueInfo
}

StorageBackend defines the interface for an SQS backend.

type TagEntry

type TagEntry struct {
	Key   string `xml:"Key"`
	Value string `xml:"Value"`
}

TagEntry is a single key/value tag pair in an XML response.

type TagQueueInput

type TagQueueInput struct {
	Tags     *tags.Tags
	QueueURL string
	Region   string
}

TagQueueInput holds the input for TagQueue.

type TagQueueResponse

type TagQueueResponse struct {
	XMLName          xml.Name            `xml:"TagQueueResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

TagQueueResponse is the XML response for TagQueue.

type TaggedQueueInfo

type TaggedQueueInfo struct {
	Tags map[string]string
	ARN  string
}

TaggedQueueInfo contains a queue's ARN and tag snapshot, for use by the Resource Groups Tagging API cross-service listing.

type UntagQueueInput

type UntagQueueInput struct {
	QueueURL string
	Region   string
	TagKeys  []string
}

UntagQueueInput holds the input for UntagQueue.

type UntagQueueResponse

type UntagQueueResponse struct {
	XMLName          xml.Name            `xml:"UntagQueueResponse"`
	ResponseMetadata XMLResponseMetadata `xml:"ResponseMetadata"`
	Xmlns            string              `xml:"xmlns,attr"`
}

UntagQueueResponse is the XML response for UntagQueue.

type XMLAttribute

type XMLAttribute struct {
	Name  string `xml:"Name"`
	Value string `xml:"Value"`
}

XMLAttribute represents a Name/Value pair in SQS XML responses.

type XMLDeleteMessageBatchFailedEntry

type XMLDeleteMessageBatchFailedEntry struct {
	ID          string `xml:"Id"`
	Code        string `xml:"Code"`
	Message     string `xml:"Message"`
	SenderFault bool   `xml:"SenderFault"`
}

XMLDeleteMessageBatchFailedEntry is a failed batch delete entry.

type XMLDeleteMessageBatchResult

type XMLDeleteMessageBatchResult struct {
	Successful []XMLDeleteMessageBatchResultEntry `xml:"DeleteMessageBatchResultEntry"`
	Failed     []XMLDeleteMessageBatchFailedEntry `xml:"BatchResultErrorEntry"`
}

XMLDeleteMessageBatchResult holds the result of a DeleteMessageBatch operation.

type XMLDeleteMessageBatchResultEntry

type XMLDeleteMessageBatchResultEntry struct {
	ID string `xml:"Id"`
}

XMLDeleteMessageBatchResultEntry is a successful batch delete entry.

type XMLError

type XMLError struct {
	Detail  XMLErrorDetail `xml:"Detail"`
	Type    string         `xml:"Type"`
	Code    string         `xml:"Code"`
	Message string         `xml:"Message"`
}

XMLError holds error information in an SQS error response.

type XMLErrorDetail

type XMLErrorDetail struct{}

XMLErrorDetail is an empty element in SQS error responses.

type XMLErrorResponse

type XMLErrorResponse struct {
	XMLName   xml.Name `xml:"ErrorResponse"`
	Error     XMLError `xml:"Error"`
	Xmlns     string   `xml:"xmlns,attr"`
	RequestID string   `xml:"RequestId"`
}

XMLErrorResponse is the top-level SQS error response.

type XMLMessage

type XMLMessage struct {
	MessageID              string                `xml:"MessageId"`
	ReceiptHandle          string                `xml:"ReceiptHandle"`
	MD5OfBody              string                `xml:"MD5OfBody"`
	MD5OfMessageAttributes string                `xml:"MD5OfMessageAttributes,omitempty"`
	Body                   string                `xml:"Body"`
	Attributes             []XMLAttribute        `xml:"Attribute"`
	MessageAttributes      []XMLMessageAttribute `xml:"MessageAttribute"`
}

XMLMessage represents a message in a ReceiveMessage XML response.

type XMLMessageAttribute

type XMLMessageAttribute struct {
	Name  string                   `xml:"Name"`
	Value XMLMessageAttributeValue `xml:"Value"`
}

XMLMessageAttribute represents a user-defined message attribute in an SQS Query protocol ReceiveMessage XML response.

type XMLMessageAttributeValue

type XMLMessageAttributeValue struct {
	DataType    string `xml:"DataType"`
	StringValue string `xml:"StringValue,omitempty"`
	BinaryValue string `xml:"BinaryValue,omitempty"` // base64-encoded raw bytes
}

XMLMessageAttributeValue holds the typed value of a user-defined message attribute in SQS Query protocol (XML) responses, matching the AWS wire format. BinaryValue is base64-encoded because Go's encoding/xml does not automatically base64-encode []byte fields (unlike encoding/json), and AWS requires base64 on the wire.

type XMLResponseMetadata

type XMLResponseMetadata struct {
	RequestID string `xml:"RequestId"`
}

XMLResponseMetadata holds the request ID for all SQS XML responses.

type XMLSendMessageBatchFailedEntry

type XMLSendMessageBatchFailedEntry struct {
	ID          string `xml:"Id"`
	Code        string `xml:"Code"`
	Message     string `xml:"Message"`
	SenderFault bool   `xml:"SenderFault"`
}

XMLSendMessageBatchFailedEntry is a failed batch send entry.

type XMLSendMessageBatchResult

type XMLSendMessageBatchResult struct {
	Successful []XMLSendMessageBatchResultEntry `xml:"SendMessageBatchResultEntry"`
	Failed     []XMLSendMessageBatchFailedEntry `xml:"BatchResultErrorEntry"`
}

XMLSendMessageBatchResult holds the result of a SendMessageBatch operation.

type XMLSendMessageBatchResultEntry

type XMLSendMessageBatchResultEntry struct {
	ID                     string `xml:"Id"`
	MessageID              string `xml:"MessageId"`
	MD5OfMessageBody       string `xml:"MD5OfMessageBody"`
	MD5OfMessageAttributes string `xml:"MD5OfMessageAttributes,omitempty"`
}

XMLSendMessageBatchResultEntry is a successful batch send entry.

Jump to

Keyboard shortcuts

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