Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DisableHandler ¶ added in v0.6.0
type DisableHandler struct { }
func (*DisableHandler) Destroy ¶ added in v0.6.0
func (d *DisableHandler) Destroy()
func (*DisableHandler) DoChain ¶ added in v0.6.0
func (d *DisableHandler) DoChain(ctx service.IHttpContext) error
type DriverConfig ¶
type DriverConfig struct { Listen int `json:"listen" yaml:"listen" title:"port" description:"使用端口" default:"80" label:"端口号" maximum:"65535"` Method []string `json:"method" yaml:"method" enum:"GET,POST,PUT,DELETE,PATH,HEAD,OPTIONS" label:"请求方式"` Host []string `json:"host" yaml:"host" label:"域名"` Rules []DriverRule `json:"rules" yaml:"rules" label:"路由规则"` Target eosc.RequireId `json:"target" yaml:"target" skill:"github.com/eolinker/apinto/service.service.IService" required:"true" label:"目标服务"` Disable bool `json:"disable" yaml:"disable" label:"禁用路由"` Plugins map[string]*plugin.Config `json:"plugins" yaml:"plugins" label:"插件配置"` }
DriverConfig http路由驱动配置
type DriverRule ¶
type DriverRule struct { Location string `json:"location" yaml:"location"` Header map[string]string `json:"header" yaml:"header" label:"请求头部(key:value类型)"` Query map[string]string `json:"query" yaml:"query" label:"query参数(key:value类型)"` }
DriverRule http路由驱动配置Rule结构体
type HTTPRouterDriver ¶
type HTTPRouterDriver struct {
// contains filtered or unexported fields
}
HTTPRouterDriver 实现github.com/eolinker/eosc.eosc.IProfessionDriver接口
func (*HTTPRouterDriver) ConfigType ¶
func (h *HTTPRouterDriver) ConfigType() reflect.Type
ConfigType 返回http路由驱动配置的反射类型
func (*HTTPRouterDriver) Create ¶
func (h *HTTPRouterDriver) Create(id, name string, v interface{}, workers map[eosc.RequireId]interface{}) (eosc.IWorker, error)
Create 创建一个http路由驱动实例
func (*HTTPRouterDriver) NewRouter ¶
func (h *HTTPRouterDriver) NewRouter(id, name string, c *DriverConfig, target service.IServiceCreate) (*Router, error)
NewRouter 创建http路由驱动实例
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router http路由驱动实例结构体,实现了worker接口
type RouterDriverFactory ¶
type RouterDriverFactory struct { }
RouterDriverFactory http路由驱动工厂结构体
func NewRouterDriverFactory ¶
func NewRouterDriverFactory() *RouterDriverFactory
NewRouterDriverFactory 创建一个http路由驱动工厂
func (*RouterDriverFactory) Create ¶
func (r *RouterDriverFactory) Create(profession string, name string, label string, desc string, params map[string]interface{}) (eosc.IExtenderDriver, error)
Create 创建http路由驱动
func (*RouterDriverFactory) Render ¶ added in v0.6.0
func (r *RouterDriverFactory) Render() interface{}
type RouterHandler ¶
type RouterHandler struct {
// contains filtered or unexported fields
}
func NewDisableHandler ¶ added in v0.6.0
func NewDisableHandler(routerConfig *router_http.Config) *RouterHandler
func NewRouterHandler ¶
func NewRouterHandler(routerConfig *router_http.Config, handler service2.IService) *RouterHandler
func (*RouterHandler) Destroy ¶
func (r *RouterHandler) Destroy()
func (*RouterHandler) DoFilter ¶
func (r *RouterHandler) DoFilter(ctx service.IHttpContext, next service.IChain) (err error)
Click to show internal directories.
Click to hide internal directories.