postgresstore

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *Config, options ...Option) (*postgresStore, error)

New constructs an postgresStore.

Types

type Config

type Config struct {
	Host       string
	Port       int
	User       string
	Password   string
	DBName     string
	SearchPath string
}

Config holds the state for a PostgreSQL DB config.

func NewConfigFromEnvironment added in v0.6.0

func NewConfigFromEnvironment() (*Config, error)

NewConfigFromEnvironment loads a Postgres config from environment variables.

func (Config) DataSourceName

func (c Config) DataSourceName() string

DataSourceName returns the DSN for a PostgreSQL DB.

type JsonSerializer

type JsonSerializer interface {
	rangedb.EventBinder
	rangedb.EventTypeIdentifier
}

JsonSerializer defines the interface to bind events and identify event types.

type Option

type Option func(*postgresStore)

Option defines functional option parameters for postgresStore.

func WithClock

func WithClock(clock clock.Clock) Option

WithClock is a functional option to inject a clock.Clock.

func WithPgNotify added in v0.6.0

func WithPgNotify() Option

WithPgNotify enables pg_notify() for notifying subscribers.

func WithUUIDGenerator added in v0.12.0

func WithUUIDGenerator(uuidGenerator shortuuid.Generator) Option

WithUUIDGenerator is a functional option to inject a shortuuid.Generator.

type PostgresJsonRecord added in v0.6.0

type PostgresJsonRecord struct {
	AggregateType        string `json:"aggregatetype"`
	AggregateID          string `json:"aggregateid"`
	GlobalSequenceNumber uint64 `json:"globalsequencenumber"`
	StreamSequenceNumber uint64 `json:"streamsequencenumber"`
	InsertTimestamp      uint64 `json:"inserttimestamp"`
	EventID              string `json:"eventid"`
	EventType            string `json:"eventtype"`
	Data                 string `json:"data"`
	Metadata             string `json:"metadata"`
}

PostgresJsonRecord holds a JSON record sent via pg_notify.

Jump to

Keyboard shortcuts

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