awsreaders

package
v0.0.0-...-97bc4b4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package aws implements InputReader(s) that access AWS services (S3 and SQS)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketReader

func BucketReader(bucket, prefix, delim, start string, max int, short bool) chan string

BucketReader returns a "list" of object names as read by listing the input S3 bucket. if "short" is false each line contains the object info (key lastModified size)

func Debug

func Debug(d bool)

Enable additional debug logging

func QueueReader

func QueueReader(queue string) chan string

QueueReader returns a list of messages read from the input SQS queue.

Note that it always releases the old message when asking for a new one. If the client wants control on the old message it should use QueueReaderWithContext instead.

func QueueReaderWait

func QueueReaderWait(queue string, wait bool) chan string

QueueReaderWait returns a list of messages read from the input SQS queue. The wait flag controls if terminate when the queue is empty or wait for new message.

Note that it always releases the old message when asking for a new one. If the client wants control on the old message it should use QueueReaderWithContext instead.

func QueueReaderWithContext

func QueueReaderWithContext(ctx *QueueReaderContext) chan string

QueueReaderWithContext returns a list of messages read from the input SQS queue.

It will normally release the last message before fetching a new one. If the client wants to "keep" the last message (so that it gets re-delivered) it should set ctx.Last = nil before fetching a new message.

Types

type QueueReaderContext

type QueueReaderContext struct {
	Queue  string
	Client *sqs.Client
	Last   *types.Message
	Wait   bool
}

QueueReaderContext is the context for QueueReader

It keeps track of the last message fetched from the queue in order to release it. If the client doesn't want the last message to be release it, it should set QueueReaaderContext.Last = nil before fetching the next message from the queue

Jump to

Keyboard shortcuts

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