Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
Endpoint func(ctx context.Context,request interface{}) (response interface{},err error)
type MiddleWare ¶
MiddleWare 方便链式操作
func Chain ¶
func Chain(outer MiddleWare, others ...MiddleWare) MiddleWare
Chain 连接成链路 outer 最外层的
Example ¶
e := Chain(
annotate("first"),
annotate("second"),
annotate("third"),
)(myEndpoint)
if _, err := e(ctx, req); err != nil {
panic(err)
}
Click to show internal directories.
Click to hide internal directories.