decorator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler[C any] interface {
	Handle(ctx context.Context, cmd C) error
}

根据C定义不同的命令接口

func ApplyCommandDecorators

func ApplyCommandDecorators[H any](handler CommandHandler[H], logger log.Logger) CommandHandler[H]

命令的装饰器。最外层是日志,其次是测量,最后才是业务命令

type QueryHandler

type QueryHandler[Q any, R any] interface {
	Handle(ctx context.Context, q Q) (R, error)
}

func ApplyQueryDecorators

func ApplyQueryDecorators[H any, R any](handler QueryHandler[H, R], logger log.Logger) QueryHandler[H, R]

Jump to

Keyboard shortcuts

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