gosns

package
v0.0.0-...-26e3963 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const InvalidProtocolErr = "INVALID_SUBSCRIPTION_PROTOCOL"

InvliadProtocolErr is returned when an invalid value is passed to the Subscribe function.

View Source
const InvalidSvcArgErr = "INVALID_SVC_ARG_TYPE"

InvalidSvcArgErr is returned when an interface object passed as the svc argument to the package methods is not the AWS *sns.SNS type.

Variables

This section is empty.

Functions

func CreateTopic

func CreateTopic(svc interface{}, name string) (string, error)

CreateTopic creates a new SNS topic with the given name.

func InitSesh

func InitSesh() interface{}

InitSesh intitializes a new SNS client session and returns the AWS *sns.SNS object as an interface type to maintain encapsulation of the AWS sns package. The *sns.SNS type is asserted by the methods used in this package, which return the InvalidSvcArgErr if the type is invalid.

func ListTopics

func ListTopics(svc interface{}) ([]string, error)

ListTopics prints and returns a list of all SNS topics' ARNs in the AWS account.

func Publish

func Publish(svc interface{}, msgStr, topicArn string) (string, error)

Publish publishes a new message to a Topic and returns the message ID of the published message.

func Subscribe

func Subscribe(svc interface{}, endpoint, protocol, topicArn string) (string, error)

Subscribe creates a new subscription for an endpoint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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