esrcpg

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 12 Imported by: 0

README

esrcpg

PostgreSQL event store for the esrc project

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStore

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

func NewEventStore

func NewEventStore(pool *pgxpool.Pool) *EventStore

func (*EventStore) AddAggregate

func (es *EventStore) AddAggregate(ctx context.Context, t esrc.AggregateType, id esrc.ID, events []esrc.RawEvent) error

func (*EventStore) AddSnapshot

func (es *EventStore) AddSnapshot(ctx context.Context, _ esrc.AggregateType, id esrc.ID, snapshot esrc.RawSnapshot) error

func (*EventStore) AppendEvents

func (es *EventStore) AppendEvents(ctx context.Context, _ esrc.AggregateType, id esrc.ID, fromVersion int, events []esrc.RawEvent) error

func (*EventStore) ContainsAggregate

func (es *EventStore) ContainsAggregate(ctx context.Context, _ esrc.AggregateType, id esrc.ID) (bool, error)

func (*EventStore) Events

func (es *EventStore) Events(ctx context.Context, _ esrc.AggregateType, id esrc.ID, fromVersion int) ([]esrc.RawEvent, error)

func (*EventStore) LatestSnapshot

func (es *EventStore) LatestSnapshot(ctx context.Context, _ esrc.AggregateType, id esrc.ID) (*esrc.RawSnapshot, error)

type EventStoreOutbox

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

func NewEventStoreOutbox

func NewEventStoreOutbox(pool *pgxpool.Pool) *EventStoreOutbox

func (*EventStoreOutbox) MarkEventsAsPublised

func (o *EventStoreOutbox) MarkEventsAsPublised(ctx context.Context, events []relay.RelayEvent) error

func (*EventStoreOutbox) UnpublishedEvents

func (o *EventStoreOutbox) UnpublishedEvents(ctx context.Context) ([]relay.RelayEvent, error)

Jump to

Keyboard shortcuts

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