storagepostgres

package
v0.0.0-...-5fa8032 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Schema = `` /* 1036-byte string literal not displayed */

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(ctx context.Context, pool *pgxpool.Pool) error

func DropSchema

func DropSchema(ctx context.Context, pool *pgxpool.Pool) error

Types

type Storage

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

func New

func New(
	pool *pgxpool.Pool,
	streamName string,
	blankStream func() *stream.Stream,
	opts ...StorageOption,
) Storage

func (Storage) Drop

func (s Storage) Drop(ctx context.Context, streamID uuid.UUID) error

func (Storage) Load

func (s Storage) Load(ctx context.Context, streamID uuid.UUID) (*stream.Stream, error)

func (Storage) NewStream

func (s Storage) NewStream() *stream.Stream

func (Storage) Persist

func (s Storage) Persist(ctx context.Context, ss *stream.Stream) (err error)

func (Storage) StreamName

func (s Storage) StreamName() string

type StorageOption

type StorageOption func(*Storage)

func WithCodec

func WithCodec(c event.Encoding) StorageOption

func WithJournal

func WithJournal() StorageOption

Jump to

Keyboard shortcuts

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