sns

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 7 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 {
	Publish(ctx context.Context, params *sns.PublishInput, optFns ...func(*sns.Options)) (*sns.PublishOutput, error)
}

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

type Option

type Option func(*Publisher)

Option is a function to set options to Publisher.

func WithDefaultOrderingKey

func WithDefaultOrderingKey(key string) Option

WithDefaultOrderingKey setups the default ordering key.

func WithFifoQueue

func WithFifoQueue(fifo bool) Option

WithFifoQueue setups the flag to use fifo queue.

func WithMetaOrderingKey

func WithMetaOrderingKey(key string) Option

WithMetaOrderingKey setups the metadata key to get the ordering key.

type Publisher

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

Publisher handles the pubsub topic messages.

func New

func New(cli Client, topicARN string, opts ...Option) (*Publisher, error)

New returns a new Publisher instance.

func Open

func Open(awsOpts sns.Options, topicARN string, opts ...Option) (*Publisher, error)

Open 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.

Jump to

Keyboard shortcuts

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