awsutils

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0, MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobMarshaller

type JobMarshaller[Job any, Message any] interface {
	Marshall(job Job) (SerializedJob[Message], error)
	Unmarshall(SerializedJob[Message]) (Job, error)
}

type SQSDecoder

type SQSDecoder[Job any, Message any] struct {
	// contains filtered or unexported fields
}

SQSDecoder provides interfaces for working with jobs received over SQS

func NewSQSDecoder

func NewSQSDecoder[Job any, Message any](cfg aws.Config, bucket string, marshaller JobMarshaller[Job, Message]) *SQSDecoder[Job, Message]

NewSQSDecoder returns a new decoder for the given AWS config

func (*SQSDecoder[Job, Message]) DecodeMessage

func (s *SQSDecoder[Job, Message]) DecodeMessage(ctx context.Context, receiptHandle string, messageBody string) (queuepoller.WithID[Job], error)

DecodeMessage decodes a provider caching job from the SQS message body, reading the stored index from S3

type SQSExtendedQueue

type SQSExtendedQueue[Job any, Message any] struct {
	// contains filtered or unexported fields
}

SQSExtendedQueue implements a queue interface using SQS that can store extended data to an S3 bucket

func NewSQSExtendedQueue

func NewSQSExtendedQueue[Job any, Message any](cfg aws.Config, queueID string, bucket string, marshaller JobMarshaller[Job, Message]) *SQSExtendedQueue[Job, Message]

NewSQSExtendedQueue returns a new SQSExtendedQueue for the given aws config

func (*SQSExtendedQueue[Job, Message]) Delete

func (s *SQSExtendedQueue[Job, Message]) Delete(ctx context.Context, jobID string) error

Delete deletes a job message from the SQS queue.

func (*SQSExtendedQueue[Job, Message]) Queue

func (s *SQSExtendedQueue[Job, Message]) Queue(ctx context.Context, job Job) error

Queue implements blobindexlookup.CachingQueue.

func (*SQSExtendedQueue[Job, Message]) Read

func (s *SQSExtendedQueue[Job, Message]) Read(ctx context.Context, maxJobs int) ([]queuepoller.WithID[Job], error)

Read reads a batch of jobs from the SQS queue. Returns an empty slice if no jobs are available. The caller must process jobs and delete them from the queue when done.

func (*SQSExtendedQueue[Job, Message]) Release

func (s *SQSExtendedQueue[Job, Message]) Release(ctx context.Context, jobID string) error

Release makes a job available for processing again by making it visible in the queue

type SerializedJob

type SerializedJob[Message any] struct {
	GroupID  *string
	Message  Message
	Extended io.Reader
}

SerializedJob represents a job that has been serialized for transport over SQS + S3

Jump to

Keyboard shortcuts

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