Documentation
¶
Index ¶
- Variables
- func NewPartialBASE64Topic(topicARN string, opts ...Option) (msg.Topic, error)
- func NewTopic(topicARN string, opts ...Option) (msg.Topic, error)
- func NewUnencodedTopic(topicARN string, opts ...Option) (msg.Topic, error)
- type BatchedTopic
- type BatchedTopicS
- type MessageWriter
- type Option
- type Topic
Constants ¶
This section is empty.
Variables ¶
var NewSNSPublisherFunc = func(sess *session.Session, cfgs ...*aws.Config) awsinterfaces.SNSPublisher { if len(cfgs) == 0 { return sns.New(sess) } else { return sns.New(sess, cfgs...) } }
DI to support mocking
Functions ¶
func NewPartialBASE64Topic ¶
NewPartialBASE64Topic returns a sns.Topic with fully configured SNSAPI.
Note: SQS has limited support for unicode characters. - See http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-messages.html Because we use SNS and SQS together, we recommend that SNS messages are *partially* base64-encoded: only the unicode fragments not supported by SQS are encoded. You may use NewUnencodedTopic if you wish to ignore the encoding step.
func NewTopic ¶
NewTopic returns a sns.Topic with fully configured SNSAPI.
Note: SQS has limited support for unicode characters. - See http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-messages.html Because we use SNS and SQS together, we recommend that SNS messages are base64-encoded as a best practice. You may use NewUnencodedTopic if you wish to ignore the encoding step.
Types ¶
type BatchedTopic ¶
NewBatchedTopic creates an concrete SNS msg.Topic It returns msg.Topic as opposed to BatchedTopic so that existing calls to NewTopic could simply replace it with NewBatchedTopic Messages published by the `Batcher` returned will be partially base64-encoded: only runes SQS does not support will be encoded. And these messages will be batched for transmission.
func NewBatchedTopic ¶
func NewBatchedTopic(topicARN string, timeout ...time.Duration) (BatchedTopic, error)
type MessageWriter ¶
type MessageWriter struct { msg.MessageWriter // contains filtered or unexported fields }
MessageWriter writes data to an output SNS batcher as configured via its topicARN.
func (*MessageWriter) Attributes ¶
func (w *MessageWriter) Attributes() *msg.Attributes
Attributes returns the msg.Attributes associated with the MessageWriter.
func (*MessageWriter) Close ¶
func (w *MessageWriter) Close() error
Close converts the MessageWriter's Body and Attributes to sns.PublishInput in order to publish itself to the MessageWriter's snsClient.
On the first call to Close, the MessageWriter is set to "isClosed" therefore blocking subsequent Close and Write calls.
type Option ¶
Option is the signature that modifies a `Batcher` to set some configuration
func WithCustomRetryer ¶
WithCustomRetryer sets a custom `Retryer` to use on the SQS client.
func WithRetries ¶
WithRetries makes the `Server` retry on credential errors until `max` attempts with `delay` seconds between requests. This is needed in scenarios where credentials are automatically generated and the program starts before AWS finishes propagating them
type Topic ¶
type Topic struct { Svc awsinterfaces.SNSPublisher TopicARN string Batcher batching.Batcher // contains filtered or unexported fields }
Topic configures and manages SNSAPI for sns.MessageWriter.