event

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchEvent

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

CloudWatchEvent is for publishing events to Event Bus

func NewCloudWatchEvent

func NewCloudWatchEvent(cw cloudwatcheventsiface.CloudWatchEventsAPI, detailType string) (*CloudWatchEvent, error)

NewCloudWatchEvent creates a new AWS Eventing Bus

func (*CloudWatchEvent) Publish

func (c *CloudWatchEvent) Publish(i interface{}) error

Publish an event to the topic

type NewServiceInput

type NewServiceInput struct {
	SnsClient              snsiface.SNSAPI
	SqsClient              sqsiface.SQSAPI
	CweClient              cloudwatcheventsiface.CloudWatchEventsAPI
	AccountCreatedTopicArn string `env:"ACCOUNT_CREATED_TOPIC_ARN" envDefault:"arn:aws:sns:us-east-1:123456789012:account-create"`
	AccountDeletedTopicArn string `env:"ACCOUNT_DELETED_TOPIC_ARN" envDefault:"arn:aws:sns:us-east-1:123456789012:account-delete"`
	AccountResetQueueURL   string `env:"RESET_SQS_URL" envDefault:"DefaultResetSQSUrl"`
	LeaseAddedTopicArn     string `env:"LEASE_ADDED_TOPIC" envDefault:"arn:aws:sns:us-east-1:123456789012:lease-added"`
}

NewServiceInput are the items required to create a new Eventer service

type Publisher

type Publisher interface {
	Publish(i interface{}) error
}

Publisher interface defines anything that can publish an event

type Service

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

Service is the public interface for publishing events

func NewService

func NewService(input NewServiceInput) (*Service, error)

NewService creates a new instance of Eventer

func (*Service) AccountCreate

func (e *Service) AccountCreate(data *account.Account) error

AccountCreate publish events

func (*Service) AccountDelete

func (e *Service) AccountDelete(data *account.Account) error

AccountDelete publish events

func (*Service) AccountReset

func (e *Service) AccountReset(data *account.Account) error

AccountReset publish events

func (*Service) AccountUpdate

func (e *Service) AccountUpdate(old *account.Account, new *account.Account) error

AccountUpdate publish events

func (*Service) LeaseCreate

func (e *Service) LeaseCreate(data *lease.Lease) error

LeaseCreate publish events

func (*Service) LeaseEnd

func (e *Service) LeaseEnd(data *lease.Lease) error

LeaseEnd publish events

func (*Service) LeaseUpdate

func (e *Service) LeaseUpdate(old *lease.Lease, new *lease.Lease) error

LeaseUpdate publish events

type SnsEvent

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

SnsEvent is for publishing events to SQS

func NewSnsEvent

func NewSnsEvent(sns snsiface.SNSAPI, a string) (*SnsEvent, error)

NewSnsEvent creates a new SNS eventing struct

func (*SnsEvent) Publish

func (s *SnsEvent) Publish(i interface{}) error

Publish an event to the topic

type SqsEvent

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

SqsEvent is for publishing events to SQS

func NewSqsEvent

func NewSqsEvent(sqs sqsiface.SQSAPI, url string) (*SqsEvent, error)

NewSqsEvent creates a new SQS eventing struct

func (*SqsEvent) Publish

func (s *SqsEvent) Publish(i interface{}) error

Publish an event to the topic

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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