Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Registry ¶
func Registry(x MiddlewareBuilder)
Types ¶
type Config ¶
type Config struct { Name string `json:"name" yaml:"name"` Data RawMessage `json:"data" yaml:"data"` }
type Middleware ¶
Middleware is HTTP/gRPC/Mqc/Cron transport middleware.
func BuildMiddlewareList ¶ added in v0.7.1
func BuildMiddlewareList(cfglist []Config) (midwares []Middleware, err error)
生成中间件列表
func Chain ¶
func Chain(m ...Middleware) Middleware
Chain returns a Middleware that specifies the chained handler for endpoint.
func Resolve ¶
func Resolve(m *Config) (Middleware, error)
type MiddlewareBuilder ¶
type MiddlewareBuilder interface { Build(data *Config) (Middleware, error) Name() string }
type RawMessage ¶
func (*RawMessage) MarshalJSON ¶
func (m *RawMessage) MarshalJSON() ([]byte, error)
MarshalJSON returns m as the JSON encoding of m.
func (*RawMessage) MarshalYAML ¶
func (m *RawMessage) MarshalYAML() (interface{}, error)
func (*RawMessage) UnmarshalJSON ¶
func (m *RawMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *m to a copy of data.
func (*RawMessage) UnmarshalYAML ¶
func (m *RawMessage) UnmarshalYAML(value *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.