postgres

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePostgresStorage

func CreatePostgresStorage(connectionURI string) storage.Storage

Types

type PostgresCommandStore

type PostgresCommandStore struct {
	Pool      *pgxpool.Pool
	Templates storage.StringTemplate
}

func (*PostgresCommandStore) Add

func (store *PostgresCommandStore) Add(ctx context.Context, actorName string, command storage.CommandRecord) error

type PostgresEventStore

type PostgresEventStore struct {
	Pool      *pgxpool.Pool
	Templates storage.StringTemplate
}

func (*PostgresEventStore) Add

func (store *PostgresEventStore) Add(ctx context.Context, events []storage.EventRecord) error

func (*PostgresEventStore) FetchAggregatedSince

func (store *PostgresEventStore) FetchAggregatedSince(
	ctx context.Context,
	actorName string,
	actorId uuid.UUID,
	eventUUID uuid.UUID,
	idMap storage.LastEventMap,
	types storage.TypeMap) ([]storage.EventRecord, error)

func (*PostgresEventStore) FetchSince

func (store *PostgresEventStore) FetchSince(
	ctx context.Context,
	actorName string,
	actorId uuid.UUID,
	eventUUID uuid.UUID,
	types storage.TypeMap) ([]storage.EventRecord, error)

type PostgresMapStore

type PostgresMapStore struct {
	Pool      *pgxpool.Pool
	Templates storage.StringTemplate
}

func (*PostgresMapStore) AddId

func (store *PostgresMapStore) AddId(ctx context.Context, actorName string, ids spry.Identifiers, uid uuid.UUID) error
func (store *PostgresMapStore) AddLink(ctx context.Context, parentType string, parentId uuid.UUID, childType string, childId uuid.UUID) error

func (*PostgresMapStore) GetId

func (store *PostgresMapStore) GetId(ctx context.Context, actorName string, ids spry.Identifiers) (uuid.UUID, error)

func (*PostgresMapStore) GetIdMap

func (store *PostgresMapStore) GetIdMap(ctx context.Context, actorName string, uid uuid.UUID) (storage.AggregateIdMap, error)

type PostgresSnapshotStore

type PostgresSnapshotStore struct {
	Pool      *pgxpool.Pool
	Templates storage.StringTemplate
}

func (*PostgresSnapshotStore) Add

func (store *PostgresSnapshotStore) Add(ctx context.Context, actorName string, snapshot storage.Snapshot, allowPartition bool) error

func (*PostgresSnapshotStore) Fetch

func (store *PostgresSnapshotStore) Fetch(ctx context.Context, actorName string, actorId uuid.UUID) (storage.Snapshot, error)

type PostgresTxProvider

type PostgresTxProvider struct {
	Pool *pgxpool.Pool
}

func (PostgresTxProvider) Commit

func (txp PostgresTxProvider) Commit(ctx context.Context) error

func (PostgresTxProvider) GetTransaction

func (txp PostgresTxProvider) GetTransaction(ctx context.Context) (pgx.Tx, error)

func (PostgresTxProvider) Rollback

func (txp PostgresTxProvider) Rollback(ctx context.Context) error

type QueryData

type QueryData struct {
	ActorName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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