http_router

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册http路由驱动工厂

Types

type Config

type Config 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:"域名"`
	Path     string         `json:"location"`
	Rules    []Rule         `json:"rules" yaml:"rules" label:"路由规则"`
	Service  eosc.RequireId `` /* 126-byte string literal not displayed */
	Template eosc.RequireId `` /* 132-byte string literal not displayed */
	Disable  bool           `json:"disable" yaml:"disable" label:"禁用路由"`
	Plugins  plugin.Plugins `json:"plugins" yaml:"plugins" label:"插件配置"`
	Retry    int            `json:"retry" label:"重试次数" yaml:"retry"`
	TimeOut  int            `json:"time_out" label:"超时时间"`
}

type Finisher added in v0.8.0

type Finisher struct {
}

func (*Finisher) Finish added in v0.8.0

func (f *Finisher) Finish(org eocontext.EoContext) error

type HTTPRouterDriver

type HTTPRouterDriver struct {
	// contains filtered or unexported fields
}

HTTPRouterDriver 实现github.com/eolinker/eosc.eosc.IProfessionDriver接口

func NewHTTPRouterDriver added in v0.8.0

func NewHTTPRouterDriver() *HTTPRouterDriver

NewHTTPRouter 创建一个http路由驱动

func (*HTTPRouterDriver) Check added in v0.8.0

func (h *HTTPRouterDriver) Check(v interface{}, workers map[eosc.RequireId]eosc.IWorker) error

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]eosc.IWorker) (eosc.IWorker, error)

Create 创建一个http路由驱动实例

type Handler added in v0.8.0

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) ServeHTTP added in v0.8.0

func (h *Handler) ServeHTTP(ctx eocontext.EoContext)

type HttpRouter added in v0.8.0

type HttpRouter struct {
	// contains filtered or unexported fields
}

func (*HttpRouter) CheckSkill added in v0.8.0

func (h *HttpRouter) CheckSkill(skill string) bool

func (*HttpRouter) Destroy added in v0.8.0

func (h *HttpRouter) Destroy() error

func (*HttpRouter) Id added in v0.8.0

func (h *HttpRouter) Id() string

func (*HttpRouter) Reset added in v0.8.0

func (h *HttpRouter) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error

func (*HttpRouter) Start added in v0.8.0

func (h *HttpRouter) Start() error

func (*HttpRouter) Stop added in v0.8.0

func (h *HttpRouter) Stop() error

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 (h *RouterDriverFactory) Render() interface{}

type Rule added in v0.8.0

type Rule struct {
	Type  string `json:"type" yaml:"type" label:"类型" enum:"header,query,cookie"`
	Name  string `json:"name" yaml:"name" label:"参数名"`
	Value string `json:"value" yaml:"value" label:"值规" `
}

Rule 规则

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL