Documentation
¶
Index ¶
- func BreakerPlugin(c *Context)
- func RatelimitPlugin(c *Context)
- type Both
- type Context
- type Handler
- type HandlerOption
- type HandlerOptions
- type Option
- func Address(a string) Option
- func Breaker(config *breaker.Config) Option
- func Codec(c codec.Codec) Option
- func Limiter(config *ratelimit.Config) Option
- func LoggerKit(kit log.Kit) Option
- func Manager(b *registry.ServiceManager) Option
- func Name(n string) Option
- func Registry(r registry.Backend) Option
- func Tags(tags map[string]string) Option
- func Tracer(tracer opentracing.Tracer) Option
- type Options
- type Plugin
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BreakerPlugin ¶
func BreakerPlugin(c *Context)
func RatelimitPlugin ¶
func RatelimitPlugin(c *Context)
Types ¶
type Both ¶
type Both struct {
// contains filtered or unexported fields
}
func (*Both) NewHandler ¶
func (b *Both) NewHandler(handler interface{}, opts ...HandlerOption) Handler
type Context ¶
type Context struct { Ctx context.Context Service string Method string RemoteAddr string Namespace string Peer string // 包含app_name的上游service_name Code int32 // rpc request raw header Header map[string]string // rpc request raw body Body []byte Request interface{} Response interface{} // contains filtered or unexported fields }
type HandlerOption ¶
type HandlerOption func(*HandlerOptions)
func HandlerName ¶
func HandlerName(name string) HandlerOption
type HandlerOptions ¶
type HandlerOptions struct {
HandlerName string
}
type Option ¶
type Option func(*Options)
func Manager ¶
func Manager(b *registry.ServiceManager) Option
func Tracer ¶
func Tracer(tracer opentracing.Tracer) Option
type Server ¶
type Server interface { NewHandler(interface{}, ...HandlerOption) Handler // registe a Handler to server Handle(Handler) error // registe middlewares to a handler Use(...Plugin) Server Start() error Stop() error GetPaths() []string }
func BinaryServer ¶
func HTTPServer ¶
Click to show internal directories.
Click to hide internal directories.