Documentation ¶
Index ¶
- func NewZipkinClientOption(name, addr string, logger *zap.Logger) (grpc.DialOption, error)
- func NewZipkinServerOption(name, addr string, logger *zap.Logger) (grpc.ServerOption, error)
- func ReadDataFromBody(w http.ResponseWriter, req *http.Request) (map[string]interface{}, error)
- type ClientRegisterFunc
- type Gateway
- type Middleware
- type Option
- func AllowHeaders(headers ...string) Option
- func AllowMethods(methods ...string) Option
- func AllowOrigins(origins ...string) Option
- func Listen(addr string) Option
- func Logger(logger *zap.Logger) Option
- func Name(name string) Option
- func Registry(registry registry.Registry) Option
- func TLS(certFile, keyFile string) Option
- func TTL(ttl int) Option
- func Trans(endpoints ...*config.EndPoint) Option
- func Version(version string) Option
- func WithConfig(conf *config.GatewayConfig) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewZipkinClientOption ¶
func NewZipkinServerOption ¶
func ReadDataFromBody ¶
Types ¶
type ClientRegisterFunc ¶
type Gateway ¶
type Gateway interface { // Options 返回网关配置 Options() *Options // Use 添加中间件实例 Use(middlewares ...Middleware) Gateway // Handle 添加Http处理器 Handle(method, pattern string, handler runtime.HandlerFunc) Gateway // Transport 向网关注册处理器方法 Transport(serverName string, registerFunc ...ClientRegisterFunc) Gateway // Start 起动网关 Start() }
Gateway 网关定义
type Option ¶
type Option func(*Options)
func AllowHeaders ¶
func AllowMethods ¶
func AllowOrigins ¶
func WithConfig ¶
func WithConfig(conf *config.GatewayConfig) Option
Click to show internal directories.
Click to hide internal directories.