12345678910111213141516171819202122232425262728293031323334 |
- package micro
- import (
- "context"
- )
- type (
- HandleOptions struct {
- HttpMethod string
- DisableRpc bool
- DisableHttp bool
- }
- HandleOption func(o *HandleOptions)
- HandleFunc func(ctx Context) (err error)
- Application interface {
- Handle(method string, cb HandleFunc) (err error) //注册一个处理器
- NewRequest(service, method string, payload interface{}) (err error) //创建一个rpc请求
- }
- Server interface {
- Start(ctx context.Context) (err error)
- Stop() (err error)
- }
- )
- func WithHttpMethod(method string) HandleOption {
- return func(o *HandleOptions) {
- o.HttpMethod = method
- }
- }
|