publisher

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCredentials

func ConvertCredentials[T IPublisherOptions](creds string) T

Types

type AwsOptions

type AwsOptions struct {
	AccessKey   string `json:"access_key"`
	SecretKey   string `json:"secret_key"`
	Region      string `validate:"required"`
	QueueUrl    string `json:"queue"`
	SnsTopicArn string `json:"sns"`
}

type IPublisher

type IPublisher interface {
	Publish(message string)
}

func NewPublisher

func NewPublisher(publisherType PublisherType, credentials string) IPublisher

type IPublisherOptions

type IPublisherOptions interface {
	// contains filtered or unexported methods
}

type PublisherType

type PublisherType string
const (
	AwsSQS PublisherType = "sqs"
	AwsSNS               = "sns"
)

type SnsPublisher

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

func NewSnsPublisher

func NewSnsPublisher(options AwsOptions) SnsPublisher

func (SnsPublisher) Publish

func (p SnsPublisher) Publish(message string)

type SqsPublisher

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

func NewSqsPublisher

func NewSqsPublisher(options AwsOptions) SqsPublisher

func (SqsPublisher) Publish

func (p SqsPublisher) Publish(message string)

Jump to

Keyboard shortcuts

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