proxy_rewrite_v2

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "proxy_rewrite_v2"
)

Variables

This section is empty.

Functions

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 Driver

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

func (*Driver) Check

func (d *Driver) Check(v interface{}, workers map[eosc.RequireId]interface{}) error

func (*Driver) ConfigType

func (d *Driver) ConfigType() reflect.Type

func (*Driver) Create

func (d *Driver) Create(id, name string, v interface{}, workers map[eosc.RequireId]interface{}) (eosc.IWorker, error)

type Factory

type Factory struct {
}

func NewFactory

func NewFactory() *Factory

func (*Factory) Create

func (f *Factory) Create(profession string, name string, label string, desc string, params map[string]interface{}) (eosc.IExtenderDriver, error)

func (*Factory) Render

func (f *Factory) Render() interface{}

type ProxyRewrite

type ProxyRewrite struct {
	*Driver
	// contains filtered or unexported fields
}

func (*ProxyRewrite) CheckSkill

func (p *ProxyRewrite) CheckSkill(skill string) bool

func (*ProxyRewrite) Destroy

func (p *ProxyRewrite) Destroy()

func (*ProxyRewrite) DoFilter

func (*ProxyRewrite) Id

func (p *ProxyRewrite) Id() string

func (*ProxyRewrite) Reset

func (p *ProxyRewrite) Reset(v interface{}, workers map[eosc.RequireId]interface{}) error

func (*ProxyRewrite) Start

func (p *ProxyRewrite) Start() error

func (*ProxyRewrite) Stop

func (p *ProxyRewrite) Stop() error

type SPrefixPath

type SPrefixPath struct {
	PrefixPathMatch   string `json:"prefix_path_match" label:"path前缀匹配字符串"`
	PrefixPathReplace string `json:"prefix_path_replace" label:"path前缀替换字符串"`
}

type SRegexPath

type SRegexPath struct {
	RegexPathMatch   string `json:"regex_path_match" label:"path正则匹配表达式"`
	RegexPathReplace string `json:"regex_path_replace" label:"path正则替换表达式"`
}

Jump to

Keyboard shortcuts

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