aws

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

README

AWS Broker implementation

This uses SNS and SQS to produce a pub/sub broker implementation. To use this broker, you must provide AWS credentials. All queue permissions management is handled by the credentials, and all AWS-related errors are forwarded to the consumer.

Topic/Queue naming convention

All SNS topics are prefixed with pubsub__.

All SQS queues are prefixed with pubsub__<topic>_

The SNS topics and SQS queues are created on-demand whenever the topic is first published or subscribed to.

Two subscribers to the same topic with the same subscriptionID will share messages from the same message queue.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAckDeadlineOutOfRange = errors.New("The visibility timeout value is out of range. Values can be 0 to 43200 seconds")

ErrAckDeadlineOutOfRange is returned whenever an invalid duration is passed to ExtendAckDeadline

View Source
var ErrMessageRetentionPeriodOutOfRange = errors.New("The message retention period value is out of range. Values can be 60 to 1209600 seconds")

ErrMessageRetentionPeriodOutOfRange is returned whenever an invalid duration is passed to changeMessageRetentionPeriod

View Source
var ErrVisibilityTimeoutOutOfRange = errors.New("The visibility timeout value is out of range. Values can be 0 to 43200 seconds")

ErrVisibilityTimeoutOutOfRange is returned whenever an invalid duration is passed to changeVisibilityTimeout

Functions

func NewPublisher

func NewPublisher(sess *session.Session, topic string) (pubsub.Publisher, error)

NewPublisher creates a new AWS message broker that will publish messages to the given topic. TODO: info on permissions needed within the config to make this work

Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 247 characters long.

func NewSubscriber

func NewSubscriber(sess *session.Session, topic, subscriptionID string) (pubsub.Subscriber, error)

NewSubscriber creates an AWS message broker that will subscribe to the given topic with at-least-once message delivery semantics for the given subscriptionID TODO: info on permissions needed within the config to make this work

func VerifyPermissions

func VerifyPermissions(sess *session.Session) error

VerifyPermissions checks if the aws config exists and checks if it has permissions to create sns topics, send messages, create SQS topics, delete topics, and delete sqs queues

Types

This section is empty.

Jump to

Keyboard shortcuts

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