pgstore

package
v0.0.0-...-9eee1bd Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options *pg.Options, logger logrus.FieldLogger) eventstore.Store

New returns a Postgres backed store

Types

type DebugHook

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

func NewDebugHook

func NewDebugHook(logger logrus.FieldLogger) *DebugHook

func (DebugHook) AfterQuery

func (d DebugHook) AfterQuery(ctx context.Context, event *pg.QueryEvent) error

func (DebugHook) BeforeQuery

func (d DebugHook) BeforeQuery(ctx context.Context, event *pg.QueryEvent) (context.Context, error)

type PgStore

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

func (*PgStore) Load

func (p *PgStore) Load(ctx context.Context, aggregateID model.ID, tenantID model.ID, fromVersion, toVersion model.Version) (eventstore.History, error)

Load the history of events from PgStore, up to the version specified. When toVersion is 0, all events will be loaded. To start at the beginning, fromVersion should be set to 0

func (*PgStore) Save

func (p *PgStore) Save(ctx context.Context, aggregateID model.ID, tenantID model.ID, records []*eventstore.Record) error

Save the provided serialized records to PgStore

Jump to

Keyboard shortcuts

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