repository

package
v0.0.0-...-da8027b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSourcing

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

func NewEventSourcing

func NewEventSourcing(
	eventStore eventstore.Store,
	publisher eventbus.Publisher,
	snapshot snapshot.Snapshot,
	options ...Option,
) *EventSourcing

func (*EventSourcing) Load

func (r *EventSourcing) Load(ctx context.Context, st stream.Type,
	sid stream.ID, newStream MakeStream) (stream.Stream, error)

func (*EventSourcing) Save

func (r *EventSourcing) Save(ctx context.Context, s stream.Stream, expected stream.Version) (err error)

type MakeStream

type MakeStream func() stream.Stream

type Option

type Option func(r *EventSourcing)

func IgnoreSnapshotError

func IgnoreSnapshotError() Option

func WithTxn

func WithTxn(tx txn.Txn) Option

type State

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

func NewState

func NewState(
	publisher eventbus.Publisher,
	snapshot snapshot.Snapshot,
	transaction txn.Txn,
) *State

func (*State) Load

func (r *State) Load(ctx context.Context, st stream.Type, sid stream.ID, newStream MakeStream) (stream.Stream, error)

func (*State) Save

func (r *State) Save(ctx context.Context, s stream.Stream, expected stream.Version) (err error)

Jump to

Keyboard shortcuts

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