Documentation ¶
Index ¶
- func ClearNotificationRegistrations()
- func ClearRequestRegistrations()
- func Publish[TNotification any](ctx context.Context, notification TNotification) error
- func RegisterNotificationHandler[TEvent any](handler NotificationHandler[TEvent]) error
- func RegisterNotificationHandlerFactory[TEvent any](factory NotificationHandlerFactory[TEvent]) error
- func RegisterNotificationHandlers[TEvent any](handlers ...NotificationHandler[TEvent]) error
- func RegisterNotificationHandlersFactories[TEvent any](factories ...NotificationHandlerFactory[TEvent]) error
- func RegisterRequestHandler[TRequest any, TResponse any](handler RequestHandler[TRequest, TResponse]) error
- func RegisterRequestHandlerFactory[TRequest any, TResponse any](factory RequestHandlerFactory[TRequest, TResponse]) error
- func RegisterRequestPipelineBehaviors(behaviours ...PipelineBehavior) error
- func Send[TRequest any, TResponse any](ctx context.Context, request TRequest) (TResponse, error)
- type NotificationHandler
- type NotificationHandlerFactory
- type PipelineBehavior
- type RequestHandler
- type RequestHandlerFactory
- type RequestHandlerFunc
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearNotificationRegistrations ¶
func ClearNotificationRegistrations()
func ClearRequestRegistrations ¶
func ClearRequestRegistrations()
func RegisterNotificationHandler ¶
func RegisterNotificationHandler[TEvent any](handler NotificationHandler[TEvent]) error
RegisterNotificationHandler register the notification handler to mediatr registry.
func RegisterNotificationHandlerFactory ¶
func RegisterNotificationHandlerFactory[TEvent any](factory NotificationHandlerFactory[TEvent]) error
RegisterNotificationHandlerFactory register the notification handler factory to mediatr registry.
func RegisterNotificationHandlers ¶
func RegisterNotificationHandlers[TEvent any](handlers ...NotificationHandler[TEvent]) error
RegisterNotificationHandlers register the notification handlers to mediatr registry.
func RegisterNotificationHandlersFactories ¶
func RegisterNotificationHandlersFactories[TEvent any](factories ...NotificationHandlerFactory[TEvent]) error
RegisterNotificationHandlersFactories register the notification handlers factories to mediatr registry.
func RegisterRequestHandler ¶
func RegisterRequestHandler[TRequest any, TResponse any](handler RequestHandler[TRequest, TResponse]) error
RegisterRequestHandler register the request handler to mediatr registry.
func RegisterRequestHandlerFactory ¶
func RegisterRequestHandlerFactory[TRequest any, TResponse any](factory RequestHandlerFactory[TRequest, TResponse]) error
RegisterRequestHandlerFactory register the request handler factory to mediatr registry.
func RegisterRequestPipelineBehaviors ¶
func RegisterRequestPipelineBehaviors(behaviours ...PipelineBehavior) error
RegisterRequestPipelineBehaviors register the request behaviors to mediatr registry.
Types ¶
type NotificationHandler ¶
type NotificationHandlerFactory ¶
type NotificationHandlerFactory[TNotification any] func() NotificationHandler[TNotification]
type PipelineBehavior ¶
type PipelineBehavior interface {
Handle(ctx context.Context, request interface{}, next RequestHandlerFunc) (interface{}, error)
}
PipelineBehavior is a Pipeline behavior for wrapping the inner handler.
type RequestHandler ¶
type RequestHandlerFactory ¶
type RequestHandlerFactory[TRequest any, TResponse any] func() RequestHandler[TRequest, TResponse]
type RequestHandlerFunc ¶
RequestHandlerFunc is a continuation for the next task to execute in the pipeline