sns

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTopicARN

func BuildTopicARN(region, awsAccountID, topicName string) (string, error)

BuildTopicARN is used to build a topic arn

pattern: "arn:aws:sns:<region>:<aws_account_id>:<topic_name>" It returns an error if one of the parameters is empty

func NewClient

func NewClient(ctx context.Context, cfg *loaferAWS.ClientConfig) (client loafergo.SNSClient, err error)

NewClient instantiates a new sns client to be used on the SNS producer

Types

type Config

type Config struct {
	SNSClient loafergo.SNSClient
}

A Config provides service configuration for SNS producer.

type Producer

type Producer interface {
	Produce(ctx context.Context, input *PublishInput) (string, error)
}

Producer represents loafer sns producer

func NewProducer

func NewProducer(config *Config) (Producer, error)

NewProducer creates a new Producer It encapsulates the Amazon Simple Notification Service client

type PublishInput

type PublishInput struct {
	Message         string
	GroupID         string
	DeduplicationID string
	TopicARN        string
	Attributes      map[string]string
}

PublishInput has the sns event attributes

Jump to

Keyboard shortcuts

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