postgres

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateProjectorCreateSchema

func AggregateProjectorCreateSchema(projectionTable string, streamName goengine.StreamName, streamTable string) []string

AggregateProjectorCreateSchema return the sql statement needed for the postgres database in order to use the AggregateProjector

func NewSingleStreamStrategy

func NewSingleStreamStrategy(converter goengine.MessagePayloadConverter) (sql.PersistenceStrategy, error)

NewSingleStreamStrategy is the constructor postgres for PersistenceStrategy interface

func StreamProjectorCreateSchema

func StreamProjectorCreateSchema(projectionTable string, streamName goengine.StreamName, streamTable string) []string

StreamProjectorCreateSchema return the sql statement needed for the postgres database in order to use the StreamProjector

Types

type SingleStreamManager

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

SingleStreamManager is a helper for creating JSON Postgres event stores and projectors

func NewSingleStreamManager

func NewSingleStreamManager(db *sql.DB, logger goengine.Logger) (*SingleStreamManager, error)

NewSingleStreamManager return a new instance of the SingleStreamManager

func (*SingleStreamManager) NewAggregateProjector

func (m *SingleStreamManager) NewAggregateProjector(
	eventStream goengine.StreamName,
	aggregateTypeName string,
	projectionTable string,
	projection goengine.Projection,
	projectionErrorHandler driverSQL.ProjectionErrorCallback,
) (*postgres.AggregateProjector, error)

NewAggregateProjector returns a new aggregate projector instance

func (*SingleStreamManager) NewEventStore

func (m *SingleStreamManager) NewEventStore() (*postgres.EventStore, error)

NewEventStore returns a new event store instance

func (*SingleStreamManager) NewStreamProjector

func (m *SingleStreamManager) NewStreamProjector(
	projectionTable string,
	projection goengine.Projection,
	projectionErrorHandler driverSQL.ProjectionErrorCallback,
) (*postgres.StreamProjector, error)

NewStreamProjector returns a new stream projector instance

func (*SingleStreamManager) PersistenceStrategy

func (m *SingleStreamManager) PersistenceStrategy() driverSQL.PersistenceStrategy

PersistenceStrategy returns the sql persistence strategy

func (*SingleStreamManager) RegisterPayloads

func (m *SingleStreamManager) RegisterPayloads(initiators map[string]json.PayloadInitiator) error

RegisterPayloads registers a set of payload type initiators

type SingleStreamStrategy

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

SingleStreamStrategy struct represents eventstore with single stream

func (*SingleStreamStrategy) ColumnNames added in v0.9.0

func (s *SingleStreamStrategy) ColumnNames() []string

ColumnNames returns the columns that need to be inserted into the table in the correct order

func (*SingleStreamStrategy) CreateSchema

func (s *SingleStreamStrategy) CreateSchema(tableName string) []string

CreateSchema returns a valid set of SQL statements to create the event store tables and indexes

func (*SingleStreamStrategy) GenerateTableName

func (s *SingleStreamStrategy) GenerateTableName(streamName goengine.StreamName) (string, error)

GenerateTableName returns a valid table name for postgres

func (*SingleStreamStrategy) PrepareData

func (s *SingleStreamStrategy) PrepareData(messages []goengine.Message) ([]interface{}, error)

PrepareData transforms a slice of messaging into a flat interface slice with the correct column order

Jump to

Keyboard shortcuts

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