response_rewrite

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "response_rewrite"
)

Variables

This section is empty.

Functions

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	StatusCode int               `json:"status_code" label:"响应状态码" minimum:"100" description:"最小值:100"`
	Body       string            `json:"body" label:"响应内容"`
	BodyBase64 bool              `json:"body_base64" label:"是否base64加密"`
	Headers    map[string]string `json:"headers" label:"响应头部"`
	Match      *MatchConf        `json:"match" label:"匹配状态码列表"`
}

type Driver

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

func (*Driver) Check

func (d *Driver) Check(v interface{}, workers map[eosc.RequireId]eosc.IWorker) 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]eosc.IWorker) (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 added in v0.6.0

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

type MatchConf

type MatchConf struct {
	Code []int `json:"code" label:"状态码" minimum:"100" description:"最小值:100"`
}

type ResponseRewrite

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

func (*ResponseRewrite) CheckSkill

func (r *ResponseRewrite) CheckSkill(skill string) bool

func (*ResponseRewrite) Destroy

func (r *ResponseRewrite) Destroy()

func (*ResponseRewrite) DoFilter

func (r *ResponseRewrite) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)

func (*ResponseRewrite) DoHttpFilter added in v0.8.0

func (r *ResponseRewrite) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) (err error)

func (*ResponseRewrite) Id

func (r *ResponseRewrite) Id() string

func (*ResponseRewrite) Reset

func (r *ResponseRewrite) Reset(v interface{}, workers map[eosc.RequireId]eosc.IWorker) error

func (*ResponseRewrite) Start

func (r *ResponseRewrite) Start() error

func (*ResponseRewrite) Stop

func (r *ResponseRewrite) Stop() error

Jump to

Keyboard shortcuts

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