example

package
v0.0.0-...-72fea12 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CorrelationIDAttribute = "correlationID"

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoClient

type DynamoClient interface {
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
}

type DynamoStore

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

func NewDynamoStore

func NewDynamoStore(client *dynamodb.Client, targetTable string) *DynamoStore

func (*DynamoStore) PersistEvent

func (d *DynamoStore) PersistEvent(ctx context.Context, event SomeDomainEvent) error

type EventReceiver

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

func NewEventReceiver

func NewEventReceiver(client SQSClient, targetQueueURL string, options ...EventReceiverOption) *EventReceiver

NewEventReceiver creates an EventReceiver instance. By default, it will use github.com/google/uuid.NewString() to generate event IDs, however this may be overridden by providing a WithIDGenerator option.

func (*EventReceiver) ReceiveInboundEvent

func (e *EventReceiver) ReceiveInboundEvent(ctx context.Context, source, message string) error

type EventReceiverOption

type EventReceiverOption func(er *EventReceiver)

func WithIDGenerator

func WithIDGenerator(idGenerator IDGenerator) EventReceiverOption

type IDGenerator

type IDGenerator func() string

type SQSClient

type SQSClient interface {
	SendMessage(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error)
}

type SomeDomainEvent

type SomeDomainEvent struct {
	ID      string `json:"id"`
	Message string `json:"message"`
	Source  string `json:"source"`
}

Jump to

Keyboard shortcuts

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