commandbus

package
v0.0.0-...-db6235c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Type() Type
}

Command represents an application command.

type CommandBus

type CommandBus interface {
	Dispatch(ctx *gin.Context, cmd Command) (Response, errors.App)
	RegisterCommand(t Type, h Handler)
	RegisterMiddleware(m Middleware)
}

Bus defines the expected behaviour from a command bus.

type Handler

type Handler interface {
	Handle(ctx *context.Context, cmd Command) (Response, errors.App)
}

Handler defines the expected behaviour from a command handler.

type HandlerFunc

type HandlerFunc func(ctx *context.Context, cmd Command) (Response, errors.App)

type Handlers

type Handlers map[Type]Handler

type Middleware

type Middleware func(next HandlerFunc) HandlerFunc

type Response

type Response any

Response represent a struct with the information

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