separator

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ArrayCountType  = "array"
	SplitCountType  = "splite"
	LengthCountType = "length"
	CountTypes      = []string{
		ArrayCountType,
		SplitCountType,
		LengthCountType,
	}
)

Functions

This section is empty.

Types

type CountRule

type CountRule struct {
	RequestBodyType string `json:"request_body_type" label:"请求体类型" enum:"form-data,json,multipart-formdata"`
	Key             string `json:"key" label:"参数名称(支持json path)"`
	Separator       string `json:"separator" label:"分隔符" switch:"separator_type===splite"`
	SeparatorType   string `json:"separator_type" label:"分割类型" enum:"splite,array,length"`
	Max             int64  `json:"max" label:"计数最大值"`
}

type EmptyCounter added in v0.14.4

type EmptyCounter struct {
}

func NewEmptyCounter added in v0.14.4

func NewEmptyCounter() *EmptyCounter

func (*EmptyCounter) Count added in v0.14.4

func (*EmptyCounter) Max added in v0.14.4

func (e *EmptyCounter) Max() int64

func (*EmptyCounter) Name added in v0.14.4

func (e *EmptyCounter) Name() string

type FileCounter

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

func NewFileCounter

func NewFileCounter(rule *CountRule) (*FileCounter, error)

func (*FileCounter) Count

func (f *FileCounter) Count(ctx http_service.IHttpContext) (int64, error)

func (*FileCounter) Max

func (f *FileCounter) Max() int64

func (*FileCounter) Name

func (f *FileCounter) Name() string

type FormDataCounter

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

func NewFormDataCounter

func NewFormDataCounter(rule *CountRule) (*FormDataCounter, error)

func (*FormDataCounter) Count

func (*FormDataCounter) Max

func (f *FormDataCounter) Max() int64

func (*FormDataCounter) Name

func (f *FormDataCounter) Name() string

type ICounter

type ICounter interface {
	Count(ctx http_service.IHttpContext) (int64, error)
	Max() int64
	Name() string
}

func GetCounter

func GetCounter(rule *CountRule) (ICounter, error)

type JsonCounter

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

func NewJsonCounter

func NewJsonCounter(rule *CountRule) (*JsonCounter, error)

func (*JsonCounter) Count

func (j *JsonCounter) Count(ctx http_service.IHttpContext) (int64, error)

func (*JsonCounter) Max

func (j *JsonCounter) Max() int64

func (*JsonCounter) Name

func (j *JsonCounter) Name() string

Jump to

Keyboard shortcuts

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