pubsub

package
v0.0.0-...-5562678 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	TopicARN        string
	QueueURL        string
	SubscriptionARN string
}

type Butler

type Butler struct {
	Sns *sns.SNS
	Sqs *sqs.SQS
	// contains filtered or unexported fields
}

func NewButlerWithLocalstack

func NewButlerWithLocalstack() *Butler

func NewButlerWithProfile

func NewButlerWithProfile(profile string) *Butler

func (*Butler) Destroy

func (b *Butler) Destroy()

func (*Butler) Prepare

func (b *Butler) Prepare(topicName, queueName string) Broker

type Condition

type Condition struct {
	ARNEquals map[string]string
}

type MessageBody

type MessageBody struct {
	Message   string `json:"message"`
	Type      string `json:"type"`
	TopicARN  string `json:"topicArn"`
	MessageID string `json:"messageId"`
}

type PolicyDocument

type PolicyDocument struct {
	Version   string
	ID        string
	Statement []StatementEntry
}

type Publisher

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

func NewPublisher

func NewPublisher(svc *sns.SNS) *Publisher

func (*Publisher) Publish

func (p *Publisher) Publish(topicArn, message string) (string, error)

type StatementEntry

type StatementEntry struct {
	SID       string
	Effect    string
	Principal string
	Action    string
	Resource  string
	Condition Condition
}

type Subscriber

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

func NewSubscriber

func NewSubscriber(svc *sqs.SQS) *Subscriber

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, queueURL string)

type Usecase

type Usecase struct{}

func NewUsecase

func NewUsecase() *Usecase

func (*Usecase) DoAnyProcess

func (u *Usecase) DoAnyProcess(eventName string)

Write your business domain code here.

type UserEvent

type UserEvent struct {
	UserID string `json:"userId"`
	Status string `json:"status"`
	Time   int64  `json:"time"`
}

Jump to

Keyboard shortcuts

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