Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeBinary = esdb.ContentTypeBinary ContentTypeJson = esdb.ContentTypeJson )
Variables ¶
View Source
var (
ErrOptimisticConcurrency = errors.New("optimistic concurrency error")
)
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler[Command any, Event any] func(context context.Context, db *esdb.Client, command Command, opts *Options) (*Result[Event], error)
CommandHandler is a function that receives a command and returns a list of events. TODO: figure out how to avoid passing the db here. Take into consideration multi-tenancy.
func NewDecider ¶
func NewDecider[State any, Command any, Event any]( decider *onepiece.Decider[State, Command, Event], getStreamId StreamId[Command], marshalEvent MarshalEvent[Event], unmarshalEvent UnmarshalEvent[Event], getEventType GetEventType[Event], ) CommandHandler[Command, Event]
type ContentType ¶
type ContentType = esdb.ContentType
type CorrelationId ¶
type CorrelationId string
func NewCorrelationId ¶
func NewCorrelationId() *CorrelationId
type ExpectedRevision ¶
type ExpectedRevision = esdb.ExpectedRevision
type GetEventType ¶
type GetEventType[Event any] func(event Event) (*onepiecemessage.MessageType, error)
type MarshalEvent ¶
type MarshalEvent[Event any] func(event Event) (ContentType, []byte, error)
type Options ¶
type Options struct { ExpectedRevision ExpectedRevision Metadata Metadata CorrelationId *CorrelationId CausationId *CausationId }
type StreamExists ¶
type StreamExists = esdb.StreamExists
type StreamRevision ¶
type StreamRevision = esdb.StreamRevision
func Revision ¶
func Revision(value uint64) StreamRevision
Click to show internal directories.
Click to hide internal directories.