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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址