params_transformer

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormParamType string = "application/x-www-form-urlencoded"
	JsonType      string = "application/json"
	MultipartType string = "multipart/form-data"
)
View Source
const (
	Name = "params_transformer"
)

Variables

This section is empty.

Functions

func Check added in v0.9.0

func Check(conf *Config, workers map[eosc.RequireId]eosc.IWorker) error

func Create added in v0.9.0

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	Params    []*TransParam `json:"params" label:"参数列表"`
	Remove    bool          `json:"remove" label:"映射后删除原参数"`
	ErrorType string        `json:"error_type" enum:"text,json" label:"报错输出格式" `
}

type Driver

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

type ParamsTransformer

type ParamsTransformer struct {
	drivers.WorkerBase
	// contains filtered or unexported fields
}

func (*ParamsTransformer) CheckSkill

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

func (*ParamsTransformer) Destroy

func (p *ParamsTransformer) Destroy()

func (*ParamsTransformer) DoFilter

func (p *ParamsTransformer) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)

func (*ParamsTransformer) DoHttpFilter added in v0.8.0

func (p *ParamsTransformer) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) error

func (*ParamsTransformer) Reset

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

func (*ParamsTransformer) Start

func (p *ParamsTransformer) Start() error

func (*ParamsTransformer) Stop

func (p *ParamsTransformer) Stop() error

type TransParam

type TransParam struct {
	Name          string `json:"name" label:"待映射参数名称"`
	Position      string `json:"position" label:"待映射参数所在位置" enum:"header,query,body"`
	ProxyName     string `json:"proxy_name" label:"目标参数名称"`
	ProxyPosition string `json:"proxy_position" label:"目标参数所在位置" enum:"header,query,body"`
	Required      bool   `json:"required" label:"待映射参数是否必含"`
}

Jump to

Keyboard shortcuts

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