cqrs

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Command = icqrs.Command
	Query   = icqrs.Query
)

Variables

View Source
var (
	ErrHandlerNotFound    = icqrs.ErrHandlerNotFound
	ErrResultTypeMismatch = icqrs.ErrResultTypeMismatch
)

Functions

func Register

func Register[TAction icqrs.Action, TResult any](bus Bus, handler Handler[TAction, TResult])

Register delegates to internal/cqrs.Register; see that function for the handler-registration contract.

func Send

func Send[TAction icqrs.Action, TResult any](ctx context.Context, bus Bus, action TAction) (TResult, error)

Send delegates to internal/cqrs.Send; see that function for the dispatch contract.

Types

type Action

type Action = icqrs.Action

type ActionKind

type ActionKind = icqrs.ActionKind

type BaseCommand

type BaseCommand = icqrs.BaseCommand

type BaseQuery

type BaseQuery = icqrs.BaseQuery

type Behavior

type Behavior = icqrs.Behavior

type BehaviorFunc

type BehaviorFunc = icqrs.BehaviorFunc

type Bus

type Bus = icqrs.Bus

func NewBus added in v0.28.0

func NewBus(behaviors []Behavior) Bus

NewBus delegates to the internal Bus constructor; see internal/cqrs.NewBus for the behavior-ordering contract. Hosts normally obtain the Bus via dependency injection; this constructor exists for standalone use and tests.

type Handler

type Handler[TAction icqrs.Action, TResult any] = icqrs.Handler[TAction, TResult]

type HandlerFunc

type HandlerFunc[TAction icqrs.Action, TResult any] = icqrs.HandlerFunc[TAction, TResult]

type Ordered added in v0.28.0

type Ordered = icqrs.Ordered

type Unit

type Unit = icqrs.Unit

Jump to

Keyboard shortcuts

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