Documentation ¶
Overview ¶
Package sns is for messaging with AWS SNS.
Index ¶
- type SNS
- func (s *SNS) CheckTopic(topicArn string) error
- func (s *SNS) CreateTopic(topicName string, topicAttributes map[string]string) (string, error)
- func (s *SNS) DeleteTopic(topicArn string) error
- func (s *SNS) Publish(topicArn string, message []byte) error
- func (s *SNS) Ready() bool
- func (s *SNS) SubscribeQueue(topicArn string, queueArn string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SNS ¶
type SNS struct {
// contains filtered or unexported fields
}
func New ¶
New returns an SNS struct which wraps an SNS client using the default AWS credentials chain. This consults (in order) environment vars, config files, ec2 and ecs roles. Requests with recoverable errors will be retried with the default retrier. It is an error if the AWS_REGION environment variable is not set.
func NewWithMaxRetries ¶
NewWithMaxRetries returns the same as New(), but with the back off set to up to maxRetries times.
func (*SNS) CheckTopic ¶
CheckTopic checks if an SNS topic exists and is accessible given its ARN.
func (*SNS) CreateTopic ¶
CreateTopic creates an SNS topic with the specified name. You can provide a map of topic attributes if needed (can be set to nil if not). Returns the ARN of the created topic.
func (*SNS) DeleteTopic ¶
DeleteTopic delete an SNS topic.