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"` 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 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 (f *FormDataCounter) Count(ctx http_service.IHttpContext) (int64, error)
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 ¶
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
Click to show internal directories.
Click to hide internal directories.