params_check_v2

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "params_check_v2"
)

Variables

View Source
var (
	MultipartForm = "multipart/form-data"
	FormData      = "application/x-www-form-urlencoded"
	JSON          = "application/json"
)

Functions

func Create

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 {
	Logic  string   `json:"logic" label:"逻辑" enum:"and,or"`
	Params []*Param `json:"params" label:"参数列表"`
}

type IParamChecker

type IParamChecker interface {
	Check(header http_service.IHeaderReader, query http_service.IQueryReader, body interface{}, fn bodyCheckerFunc) bool
}

type Param

type Param struct {
	Name      string      `json:"name" label:"参数名"`
	Position  string      `json:"position" label:"参数位置" enum:"query,header,body"`
	MatchText string      `json:"match_text" label:"匹配文本"`
	MatchMode string      `json:"match_mode" label:"匹配模式" enum:"any,all"`
	Logic     string      `json:"logic" label:"逻辑" enum:"and,or"`
	Params    []*SubParam `json:"params" label:"参数列表"`
}

type SubParam

type SubParam struct {
	Name      string `json:"name" label:"参数名"`
	Position  string `json:"position" label:"参数位置" enum:"query,header,body"`
	MatchText string `json:"match_text" label:"匹配文本"`
	MatchMode string `json:"match_mode" label:"匹配模式" enum:"any,all"`
}

Jump to

Keyboard shortcuts

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