postgres

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAggregateID = errors.New("aggregate id missing. cannot load aggregate")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable          bool   `env:"POSTGRES_STORAGE_ENABLE" yaml:"enable"`
	Uri             string `env:"POSTGRES_STORAGE_URI" default:"" yaml:"uri"`
	DatabaseName    string `env:"POSTGRES_STORAGE_DATABASE_NAME" default:"" yaml:"databaseName"`
	MigrationsPath  string `env:"POSTGRES_STORAGE_MIGRATIONS_PATH" default:"/migrations" yaml:"migrationsPath"`
	MigrationsTable string `env:"POSTGRES_STORAGE_MIGRATIONS_TABLE" default:"" yaml:"migrationsTable"`
}

type Migrator

type Migrator interface {
	PerformMigrations(db *sql.DB, path string, databaseName string) error
}

type Storage

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

func NewPostgresEventStorage

func NewPostgresEventStorage(l *logrus.Entry, cfg Config, m Migrator) *Storage

func (*Storage) Close

func (p *Storage) Close() error

func (*Storage) Load

func (p *Storage) Load(a eventsourcing.Aggregate) error

func (*Storage) Name

func (p *Storage) Name() string

func (*Storage) Upsert

func (p *Storage) Upsert(a eventsourcing.Aggregate) error

Jump to

Keyboard shortcuts

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