Documentation
¶
Index ¶
- func After(ctx context.Context)
- func Before(ctx context.Context, fn interface{}, args ...interface{}) (context.Context, error)
- func IndirectType(reflectType reflect.Type) reflect.Type
- func RegisterCustomValueHandle(t reflect.Type, valuer CustomValueHandle)
- func RegisterNamesIn(fn interface{}, names ...string)
- func Use(middlewares ...Handler)
- type Config
- type Context
- type CustomValueHandle
- type FuncInArgs
- type FuncMetadata
- type Handler
- type Valuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCustomValueHandle ¶
func RegisterCustomValueHandle(t reflect.Type, valuer CustomValueHandle)
RegisterCustomValueHandle 注册自定义Valuer展开函数
func RegisterNamesIn ¶
func RegisterNamesIn(fn interface{}, names ...string)
RegisterNamesIn 手工注册函数的参数名称列表
Types ¶
type Config ¶
type Config struct {
sync.RWMutex
//Pkg 包名替換規則
Pkg map[string]string
//NamesIn 函数参数名称
NamesIn map[string][]string
}
Config AOP設定
type Context ¶
type Context struct {
FuncMetadata *FuncMetadata
FuncInArgs FuncInArgs
Values map[interface{}]interface{}
// contains filtered or unexported fields
}
Context aop上下文
type CustomValueHandle ¶
type CustomValueHandle func(obj interface{}) map[string]interface{}
CustomValueHandle 自定义Valuer展开函数
type FuncMetadata ¶
type FuncMetadata struct {
//Type 型別信息
Type reflect.Type
//Name 完整名稱包含包地址
Name string
//NumIn 變數數量
NumIn int
//NamesIn 變數名稱
NamesIn []string
//FixedNamesIn -/+ 修正后的参数列表
FixedNamesIn []string
}
FuncMetadata func反射後得到的元數據
Click to show internal directories.
Click to hide internal directories.