relay

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func NewCommand

func NewCommand(o EventStoreOutbox, p Publisher, opts ...CommandOption) *Command

func (*Command) Execute

func (r *Command) Execute(ctx context.Context) error

type CommandOption

type CommandOption func(*Command)

func CommandWithLogger

func CommandWithLogger(l log.Logger) CommandOption

func CommandWithMetrics

func CommandWithMetrics(eventsRelayedCount metrics.Counter) CommandOption

type EventStoreOutbox

type EventStoreOutbox interface {
	UnpublishedEvents(context.Context) ([]RelayEvent, error)
	MarkEventsAsPublised(context.Context, []RelayEvent) error
}

type Publisher

type Publisher interface {
	Publish(context.Context, RelayEvent) error
}

type RelayEvent

type RelayEvent struct {
	AggregateID esrc.ID
	Sequence    uint64
	RawEvent    esrc.RawEvent
}

func NewRelayEvent

func NewRelayEvent(aggregateID esrc.ID, sequence uint64, e esrc.RawEvent) RelayEvent

Jump to

Keyboard shortcuts

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