sns

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UUIDAttribute = "UUID"

Variables

This section is empty.

Functions

func CheckARNTopic added in v0.0.2

func CheckARNTopic(ctx context.Context, snsClient *sns.Client, topicARN string) (*string, error)

func CreateSNS added in v0.0.2

func CreateSNS(ctx context.Context, snsClient *sns.Client, topicARN string, createSNSParams sns.CreateTopicInput) (*string, error)

Types

type DefaultMarshalerUnmarshaler added in v0.0.2

type DefaultMarshalerUnmarshaler struct{}

func (DefaultMarshalerUnmarshaler) Marshal added in v0.0.2

type Marshaler added in v0.0.2

type Marshaler interface {
	Marshal(msg *message.Message) *sns.PublishInput
}

type Publisher

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

func NewPublisher

func NewPublisher(config PublisherConfig, logger watermill.LoggerAdapter) (*Publisher, error)

func (Publisher) AddSubscription added in v0.0.2

func (p Publisher) AddSubscription(ctx context.Context, config *sns.SubscribeInput) error

func (Publisher) Close

func (p Publisher) Close() error

func (Publisher) GetArnTopic added in v0.0.2

func (p Publisher) GetArnTopic(ctx context.Context, topic string) (*string, error)

func (Publisher) Publish

func (p Publisher) Publish(topic string, messages ...*message.Message) error

type PublisherConfig

type PublisherConfig struct {
	AWSConfig             aws.Config
	CreateTopicConfig     SNSConfigAtrributes
	CreateTopicfNotExists bool
	Marshaler             Marshaler
}

type SNSConfigAtrributes added in v0.0.2

type SNSConfigAtrributes struct {
	DeliveryPolicy            string `json:"DeliveryPolicy,omitempty"`
	DisplayName               string `json:"DisplayName,omitempty"`
	Policy                    string `json:"Policy,omitempty"`
	SignatureVersion          string `json:"SignatureVersion,omitempty"`
	TracingConfig             string `json:"TracingConfig,omitempty"`
	KmsMasterKeyId            string `json:"KmsMasterKeyId,omitempty"`
	FifoTopic                 string `json:"FifoTopic,omitempty"`
	ContentBasedDeduplication string `json:"ContentBasedDeduplication,omitempty"`
}

func (SNSConfigAtrributes) Attributes added in v0.0.2

func (s SNSConfigAtrributes) Attributes() map[string]string

Jump to

Keyboard shortcuts

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