cqrs

package
v0.0.0-...-4a59535 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsHandler

func AsHandler(handler interface{}, handlerGroupName string) interface{}

AsHandler annotates the given constructor to state that it provides a handler to the "handlers" group.

func IsCommand

func IsCommand(obj interface{}) bool

func IsInternalCommand

func IsInternalCommand(obj interface{}) bool

func IsNotification

func IsNotification(obj interface{}) bool

func IsQuery

func IsQuery(obj interface{}) bool

func IsRequest

func IsRequest(obj interface{}) bool

Types

type Command

type Command interface {
	Request
	TypeInfo
	// contains filtered or unexported methods
}

func NewCommandByT

func NewCommandByT[T any]() Command

type CommandHandler

type CommandHandler[TCommand Command, TResponse any] interface {
	Handle(ctx context.Context, command TCommand) (TResponse, error)
}

type CommandHandlerVoid

type CommandHandlerVoid[TCommand Command] interface {
	Handle(ctx context.Context, command TCommand) (*mediatr.Unit, error)
}

type HandlerRegisterer

type HandlerRegisterer interface {
	RegisterHandler() error
}

HandlerRegisterer for registering `RequestHandler` to mediatr registry, if handler implements this interface it will be registered automatically

type InternalCommand

type InternalCommand interface {
	Command
	// contains filtered or unexported methods
}

func NewInternalCommandByT

func NewInternalCommandByT[T any]() InternalCommand

type Notification

type Notification interface {
	TypeInfo
	// contains filtered or unexported methods
}

func NewNotificationByT

func NewNotificationByT[T any]() Notification

type Query

type Query interface {
	Request
	TypeInfo
	// contains filtered or unexported methods
}

func NewQueryByT

func NewQueryByT[T any]() Query

type QueryHandler

type QueryHandler[TQuery Query, TResponse any] interface {
	Handle(ctx context.Context, query TQuery) (TResponse, error)
}

type Request

type Request interface {
	// contains filtered or unexported methods
}

func NewRequest

func NewRequest() Request

type RequestHandlerWithRegisterer

type RequestHandlerWithRegisterer[TRequest any, TResponse any] interface {
	HandlerRegisterer
	mediatr.RequestHandler[TRequest, TResponse]
}

RequestHandlerWithRegisterer for registering `RequestHandler` to mediatr registry and handling `RequestHandler`

type TypeInfo

type TypeInfo interface {
	ShortTypeName() string
	FullTypeName() string
	Type() reflect.Type
}

func NewTypeInfoT

func NewTypeInfoT[T any]() TypeInfo

Jump to

Keyboard shortcuts

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