messaging

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventName

type EventName string
const (
	PUT EventName = "PUT"
)

type KafkaMessage

type KafkaMessage struct {
	EventName string `json:"EventName"`
	Key       string `json:"Key"`
}

func (*KafkaMessage) GetBucket

func (m *KafkaMessage) GetBucket() (string, error)

func (*KafkaMessage) GetEvent

func (m *KafkaMessage) GetEvent() (EventName, error)

func (*KafkaMessage) GetItem

func (m *KafkaMessage) GetItem() (string, error)

type KafkaProvider

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

func NewKafkaProvider

func NewKafkaProvider(mpConfig MessageProviderConfig) (KafkaProvider, error)

func (*KafkaProvider) Close

func (k *KafkaProvider) Close(ctx context.Context) error

func (*KafkaProvider) ReceiveMessage

func (k *KafkaProvider) ReceiveMessage(ctx context.Context) (Message, error)

type Message

type Message interface {
	GetEvent() (EventName, error)
	GetBucket() (string, error)
	GetItem() (string, error)
}

Message A generic message related to an S3 bucket and item

type MessageProvider

type MessageProvider interface {
	ReceiveMessage(ctx context.Context) (Message, error)
	Close(ctx context.Context) error
}

MessageProvider Reads and returns messages from a given queue (or topic)

type MessageProviderBuilder

type MessageProviderBuilder interface {
	GetMessageProvider(config MessageProviderConfig) (MessageProvider, error)
}

MessageProviderBuilder Returns a builder for a MessageProvider

func GetDefaultMessageProviderBuilder

func GetDefaultMessageProviderBuilder() MessageProviderBuilder

type MessageProviderConfig

type MessageProviderConfig struct {
	Queue    string
	Endpoint string
	Provider string
	Region   string
}

type SqsBucket

type SqsBucket struct {
	Name string `json:"name"`
}

type SqsMessage

type SqsMessage struct {
	Records []SqsRecord `json:"Records"`
}

func (*SqsMessage) GetBucket

func (m *SqsMessage) GetBucket() (string, error)

func (*SqsMessage) GetEvent

func (m *SqsMessage) GetEvent() (EventName, error)

func (*SqsMessage) GetItem

func (m *SqsMessage) GetItem() (string, error)

type SqsObject

type SqsObject struct {
	Key string `json:"key"`
}

type SqsProvider

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

func NewSqsProvider

func NewSqsProvider(mpConfig MessageProviderConfig) (SqsProvider, error)

func (*SqsProvider) Close

func (s *SqsProvider) Close(ctx context.Context) error

func (*SqsProvider) ReceiveMessage

func (s *SqsProvider) ReceiveMessage(ctx context.Context) (Message, error)

type SqsRecord

type SqsRecord struct {
	EventName string `json:"eventName"`
	S3        SqsS3  `json:"s3"`
}

type SqsS3

type SqsS3 struct {
	Object SqsObject `json:"object"`
	Bucket SqsBucket `json:"bucket"`
}

Jump to

Keyboard shortcuts

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