command

package
v0.0.0-...-b6b6a87 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	// Dispatch is the method used to dispatch new commands.
	Dispatch(context.Context, Command) error
	// Register is the method used to register a new command handler.
	Register(Type, Handler)
	Close() error
}

Bus defines the expected behaviour from a command bus.

type Command

type Command interface {
	Type() Type
}

Command represents an application command.

type Handler

type Handler interface {
	Handle(context.Context, Command) error
}

Handler defines the expected behaviour from a command handler.

type Type

type Type string

Type represents an application command type.

Jump to

Keyboard shortcuts

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