preparation

package
v1.80.0-v2.17 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrNotExecutable is thrown if no command creator was created
	ErrNotExecutable = errors.ThrowInvalidArgument(nil, "PREPA-pH70n", "Errors.Internal")
)

Functions

func PrepareCommands

func PrepareCommands(ctx context.Context, filter FilterToQueryReducer, validations ...Validation) (cmds []eventstore.Command, err error)

PrepareCommands checks the passed validations and if ok creates the commands

Types

type CreateCommands

type CreateCommands func(context.Context, FilterToQueryReducer) ([]eventstore.Command, error)

CreateCommands builds the commands the filter param is an extended version of the eventstore filter method it filters for events including the commands on the current context

type FilterToQueryReducer

type FilterToQueryReducer func(ctx context.Context, queryFactory *eventstore.SearchQueryBuilder) ([]eventstore.Event, error)

FilterToQueryReducer is an abstraction of the eventstore method

type Validation

type Validation func() (CreateCommands, error)

Validation of the input values of the command and if correct returns the function to create commands or if not valid an error

Jump to

Keyboard shortcuts

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