postgres

package
v0.0.0-...-76fafce Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnapshotStore

func NewSnapshotStore(tableName string, db DB, registry registry.Registry) es.AggregateStoreMiddleware

Types

type DB

type DB interface {
	PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

type EventStore

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

func NewEventStore

func NewEventStore(tableName string, db DB, registry registry.Registry) EventStore

func (EventStore) Load

func (s EventStore) Load(ctx context.Context, aggregate es.EventSourcedAggregate) (err error)

func (EventStore) Save

func (s EventStore) Save(ctx context.Context, aggregate es.EventSourcedAggregate) (err error)

type InboxStore

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

func NewInboxStore

func NewInboxStore(tableName string, db DB) InboxStore

func (InboxStore) Save

func (s InboxStore) Save(ctx context.Context, msg am.IncomingMessage) error

type OutboxStore

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

func NewOutboxStore

func NewOutboxStore(tableName string, db DB) OutboxStore

func (OutboxStore) FindUnpublished

func (s OutboxStore) FindUnpublished(ctx context.Context, limit int) ([]am.Message, error)

func (OutboxStore) MarkPublished

func (s OutboxStore) MarkPublished(ctx context.Context, ids ...string) error

func (OutboxStore) Save

func (s OutboxStore) Save(ctx context.Context, msg am.Message) error

type SagaStore

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

func NewSagaStore

func NewSagaStore(tableName string, db DB, registry registry.Registry) SagaStore

func (SagaStore) Load

func (s SagaStore) Load(ctx context.Context, sagaName, sagaID string) (*sec.SagaContext[[]byte], error)

func (SagaStore) Save

func (s SagaStore) Save(ctx context.Context, sagaName string, sagaCtx *sec.SagaContext[[]byte]) error

type SnapshotStore

type SnapshotStore struct {
	es.AggregateStore
	// contains filtered or unexported fields
}

func (SnapshotStore) Load

func (s SnapshotStore) Load(ctx context.Context, aggregate es.EventSourcedAggregate) error

func (SnapshotStore) Save

func (s SnapshotStore) Save(ctx context.Context, aggregate es.EventSourcedAggregate) error

Jump to

Keyboard shortcuts

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