repos

package
v0.0.0-...-74cc791 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateRepo

type AggregateRepo interface {
	CreateIfNotExist(ctx context.Context, id, typ string) error
	CheckAndUpdateVersion(ctx context.Context, agg ev.Aggregate) bool
	CreateSnapshot(ctx context.Context, agg ev.Aggregate) error
	ReadSnapshot(ctx context.Context, aggregateID string, version int, agg ev.Aggregate) bool
}

func NewAggregate

func NewAggregate(pool *pgxpool.Pool, s ev.Serializer) AggregateRepo

type EventRepo

type EventRepo interface {
	Get(ctx context.Context, aggregateID string, fromVer, toVer int, root *ev.AggregateRoot) ([]ev.Event, error)
	Append(context.Context, ev.Event) error
}

func NewEvent

func NewEvent(pool *pgxpool.Pool, s ev.Serializer) EventRepo

type Repos

type Repos interface {
	Event() EventRepo
	Aggregate() AggregateRepo
}

func New

func New(pool *pgxpool.Pool, s ev.Serializer) Repos

Jump to

Keyboard shortcuts

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