36 lines
936 B
Go
36 lines
936 B
Go
|
// Package try ...
|
||
|
//
|
||
|
// Description : try ...
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 2023-07-20 11:26
|
||
|
package try
|
||
|
|
||
|
// ICatchHandler 异常处理器接口约束
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 11:26 2023/7/20
|
||
|
type ICatchHandler interface {
|
||
|
Catch(errCode string, handler func(errCode string, data map[string]interface{})) ICatchHandler
|
||
|
CatchAll(handler func(errCode string, data map[string]interface{})) IFinalHandler
|
||
|
IFinalHandler
|
||
|
}
|
||
|
|
||
|
// IFinalHandler 所有异常 / 逻辑执行成功之后的逻辑
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 11:27 2023/7/20
|
||
|
type IFinalHandler interface {
|
||
|
Finally(data map[string]interface{}, handlers ...func(data map[string]interface{}))
|
||
|
}
|
||
|
|
||
|
// ILogicFunction 逻辑函数约束
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 11:29 2023/7/20
|
||
|
type ILogicFunction func(input *LogicFuncInput) LogicFuncOutput
|