sqs

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	DeleteMessage(context.Context, *sqs.DeleteMessageInput, ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error)
	GetQueueUrl(context.Context, *sqs.GetQueueUrlInput, ...func(*sqs.Options)) (*sqs.GetQueueUrlOutput, error)
	ReceiveMessage(context.Context, *sqs.ReceiveMessageInput, ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error)
	SendMessage(context.Context, *sqs.SendMessageInput, ...func(*sqs.Options)) (*sqs.SendMessageOutput, error)
}

Client defines the AWS SQS methods used by the Publisher. This is used for testing purposes.

type Publisher

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

Publisher handles the pubsub topic messages.

func NewPublisher added in v0.8.0

func NewPublisher(ctx context.Context, svc Client, queue string, opts ...PublisherOption) (*Publisher, error)

NewPublisher returns a new Publisher instance.

func NewPublisherFromDefault added in v0.8.0

func NewPublisherFromDefault(ctx context.Context, queue string, opts ...PublisherOption) (*Publisher, error)

NewPublisherFromDefault returns a new Publisher instance.

func (Publisher) Publish

func (p Publisher) Publish(ctx context.Context, msg messenger.Message) error

Publish publishes the given message to the pubsub topic.

type PublisherOption added in v0.8.0

type PublisherOption func(*Publisher)

PublisherOption is a function to set options to Publisher.

func PublisherWithDefaultOrderingKey added in v0.8.0

func PublisherWithDefaultOrderingKey(key string) PublisherOption

PublisherWithDefaultOrderingKey setups the default ordering key.

func PublisherWithFifoQueue added in v0.8.0

func PublisherWithFifoQueue(fifo bool) PublisherOption

PublisherWithFifoQueue setups the flag to use fifo queue.

func PublisherWithMessageIDKey added in v0.11.0

func PublisherWithMessageIDKey(key string) PublisherOption

PublisherWithMessageIDKey modify default message id key.

func PublisherWithMetaOrderingKey added in v0.8.0

func PublisherWithMetaOrderingKey(key string) PublisherOption

PublisherWithMetaOrderingKey setups the metadata key to get the ordering key.

type Subscriber added in v0.8.0

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

Subscriber registers subscriptions to AWS SQS.

func NewSubscriber added in v0.8.0

func NewSubscriber(cli Client, opts ...SubscriberOption) *Subscriber

NewSubscriber returns a new Publisher instance.

func NewSubscriberFromDefault added in v0.8.0

func NewSubscriberFromDefault(ctx context.Context, queue string, opts ...SubscriberOption) (*Subscriber, error)

NewSubscriberFromDefault returns a new Publisher instance.

func (*Subscriber) Listen added in v0.8.0

func (s *Subscriber) Listen(ctx context.Context) error

Listen starts listening for events.

func (*Subscriber) Register added in v0.8.0

func (s *Subscriber) Register(subs ...messenger.Subscription)

Register adds subscriptions to subscriber.

type SubscriberOption added in v0.8.0

type SubscriberOption func(*Subscriber)

SubscriberOption is a function to set options to Subscriber.

func SubscriberWithMaxMessages added in v0.8.0

func SubscriberWithMaxMessages(msgs int) SubscriberOption

SubscriberWithMaxMessages replaces default number of messages to receive.

func SubscriberWithMaxWaitSeconds added in v0.8.0

func SubscriberWithMaxWaitSeconds(waitSec int) SubscriberOption

SubscriberWithMaxWaitSeconds replaces default max time wait seconds.

func SubscriberWithMessageIDKey added in v0.11.0

func SubscriberWithMessageIDKey(key string) SubscriberOption

SubscriberWithMessageIDKey replaces default metadata key for id.

Jump to

Keyboard shortcuts

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