Documentation ¶
Index ¶
- Constants
- func Check(v *Config, workers map[eosc.RequireId]eosc.IWorker) error
- func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
- func NewFactory() eosc.IExtenderDriverFactory
- func Register(register eosc.IExtenderDriverRegister)
- type Config
- type ProxyRewrite
- func (p *ProxyRewrite) CheckSkill(skill string) bool
- func (p *ProxyRewrite) Destroy()
- func (p *ProxyRewrite) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)
- func (p *ProxyRewrite) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)
- func (p *ProxyRewrite) Reset(v interface{}, workers map[eosc.RequireId]eosc.IWorker) error
- func (p *ProxyRewrite) Start() error
- func (p *ProxyRewrite) Stop() error
- type SPrefixPath
- type SRegexPath
Constants ¶
View Source
const (
Name = "proxy_rewrite_v2"
)
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() eosc.IExtenderDriverFactory
func Register ¶
func Register(register eosc.IExtenderDriverRegister)
Types ¶
type Config ¶
type Config struct { PathType string `json:"path_type" label:"path重写类型" enum:"none,static,prefix,regex"` StaticPath string `json:"static_path" label:"静态path" switch:"path_type==='static'"` PrefixPath []*SPrefixPath `json:"prefix_path" label:"path前缀替换" switch:"path_type==='prefix'"` RegexPath []*SRegexPath `json:"regex_path" label:"path正则替换" switch:"path_type==='regex'"` NotMatchErr bool `json:"not_match_err" label:"path替换失败不进行转发"` HostRewrite bool `json:"host_rewrite" label:"是否重写host"` Host string `json:"host" label:"Host" switch:"host_rewrite===true"` Headers map[string]string `json:"headers" label:"请求头部"` }
type ProxyRewrite ¶
type ProxyRewrite struct { drivers.WorkerBase // contains filtered or unexported fields }
func (*ProxyRewrite) CheckSkill ¶
func (p *ProxyRewrite) CheckSkill(skill string) bool
func (*ProxyRewrite) Destroy ¶
func (p *ProxyRewrite) Destroy()
func (*ProxyRewrite) DoHttpFilter ¶ added in v0.8.0
func (p *ProxyRewrite) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)
func (*ProxyRewrite) Start ¶
func (p *ProxyRewrite) Start() error
func (*ProxyRewrite) Stop ¶
func (p *ProxyRewrite) Stop() error
type SPrefixPath ¶
type SRegexPath ¶
Click to show internal directories.
Click to hide internal directories.