|
@@ -9,16 +9,16 @@ type (
|
|
}
|
|
}
|
|
|
|
|
|
HandleOptions struct {
|
|
HandleOptions struct {
|
|
- HttpMethod string
|
|
|
|
- DisableRpc bool
|
|
|
|
- DisableHttp bool
|
|
|
|
|
|
+ DisableRpc bool //禁用RPC功能
|
|
|
|
+ DisableHttp bool //禁用HTTP功能
|
|
|
|
+ HttpPath string //重定向HTTP路由
|
|
|
|
+ HttpMethod string //HTTP路径
|
|
}
|
|
}
|
|
|
|
|
|
HandleOption func(o *HandleOptions)
|
|
HandleOption func(o *HandleOptions)
|
|
|
|
|
|
HandleFunc func(ctx Context) (err error)
|
|
HandleFunc func(ctx Context) (err error)
|
|
|
|
|
|
-
|
|
|
|
Application interface {
|
|
Application interface {
|
|
Handle(method string, cb HandleFunc, opts ...HandleOption) //注册一个处理器
|
|
Handle(method string, cb HandleFunc, opts ...HandleOption) //注册一个处理器
|
|
CreateRequest(name, method string, body interface{}) (req *Request, err error) //创建一个rpc请求
|
|
CreateRequest(name, method string, body interface{}) (req *Request, err error) //创建一个rpc请求
|