filter

package module
v0.0.0-...-b237cf8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: Apache-2.0 Imports: 10 Imported by: 1

README

filter GoDoc

Request param filters library for APIBox

See full document at: https://go-apibox.github.io/docs/#!filter/quickstart.md (Chinese)

Documentation

Index

Constants

View Source
const (
	EMAIL_RAWCASE = iota
	EMAIL_LOWERCASE
	EMAIL_UPPERCASE
)
View Source
const (
	ErrorObjectNotExist = iota
	ErrorObjectDuplicated
	ErrorNoObjectUpdated
	ErrorNoObjectDeleted
	ErrorMissingParam
	ErrorInvalidParam
	ErrorQuotaExceed
	ErrorPermissionDenied
	ErrorOperationFailed
	ErrorInternalError
)

application error value should keep synchronous with api.Error*

View Source
const (
	STRING_RAWCASE = iota
	STRING_LOWERCASE
	STRING_UPPERCASE
)

Variables

View Source
var ErrorWordMap = map[string]map[string]string{
	"en_us": map[string]string{

		"InvalidValidator": "invalid validator",

		"NotInSet":     "not in set",
		"ItemNotInSet": "item not in set",

		"NotInt":    "not int",
		"NotInt64":  "not int64",
		"NotUint":   "not uint",
		"NotUint64": "not uint64",
		"TooSmall":  "too small",
		"TooLarge":  "too large",

		"NotString":       "not string",
		"TooShort":        "too short",
		"TooLong":         "too long",
		"WrongFormat":     "wrong format",
		"NotNumeric":      "not numeric",
		"NotDigit":        "not digit",
		"NotAlpha":        "not alpha",
		"NotAlphaNumeric": "not alphanumeric",

		"NotEmail": "not email",

		"NotCIDR": "not cidr",
		"NotIP":   "not ip",
		"NotIPv4": "not IPv4",
		"NotIPv6": "not IPv6",

		"NotJson": "not json",

		"NotTimestamp": "not timestamp",
		"NotTime":      "not date",
		"TooEarly":     "too early",
		"TooLate":      "too late",

		"TooNear":    "too near",
		"TooFar":     "too far",
		"WrongRange": "wrong range",

		"NotIntRange":    "not int range",
		"NotInt64Range":  "not int64 range",
		"NotUintRange":   "not uint range",
		"NotUint64Range": "not uint64 range",
		"LeftTooSmall":   "left of range is too small",
		"LeftTooLarge":   "left of range is too large",
		"RightTooSmall":  "right of range is too small",
		"RightTooLarge":  "right of range is too large",

		"NotTimestampRange": "not timestamp range",
		"NotTimeRange":      "not date range",
		"LeftTooEarly":      "left of range is too early",
		"LeftTooLate":       "left of range is too late",
		"RightTooEarly":     "right of range is too early",
		"RightTooLate":      "right of range is too late",

		"TooFew":  "too few",
		"TooMany": "too many",

		"NotIntSet":    "not int set",
		"NotInt64Set":  "not int64 set",
		"NotUintSet":   "not uint set",
		"NotUint64Set": "not uint64 set",
		"ItemTooSmall": "item too small",
		"ItemTooLarge": "item too large",

		"NotStringSet":        "not string set",
		"ItemTooShort":        "item too short",
		"ItemTooLong":         "item too long",
		"ItemNotNumeric":      "item not numeric",
		"ItemNotDigit":        "item not digit",
		"ItemNotAlpha":        "item not alpha",
		"ItemNotAlphaNumeric": "item not alphanumeric",
		"ItemWrongFormat":     "item wrong format",

		"NotEmailSet": "not email set",

		"NotCIDRSet":  "not cidr set",
		"NotIPSet":    "not ip set",
		"ItemNotIPv4": "item not IPv4",
		"ItemNotIPv6": "item not IPv6",
	},
	"zh_cn": map[string]string{

		"InvalidValidator": "验证器非法",

		"NotInSet":     "不在集合中",
		"ItemNotInSet": "元素不在集合中",

		"NotInt":    "非int型",
		"NotInt64":  "非int64型",
		"NotUint":   "非uint型",
		"NotUint64": "非uint64型",
		"TooSmall":  "太小",
		"TooLarge":  "太大",

		"NotString":       "非字符串",
		"TooShort":        "太短",
		"TooLong":         "太长",
		"WrongFormat":     "格式错误",
		"NotNumeric":      "不是数值",
		"NotDigit":        "不是纯数字组成",
		"NotAlpha":        "不是纯字母组成",
		"NotAlphaNumeric": "不是由纯字母和数字组成",

		"NotEmail": "非邮箱地址",

		"NotCIDR": "非CIDR地址",
		"NotIP":   "非IP地址",
		"NotIPv4": "不是IPv4",
		"NotIPv6": "不是IPv6",

		"NotJson": "非JSON字符串",

		"NotTimestamp": "非时间戳",
		"NotTime":      "非日期",
		"TooEarly":     "太早",
		"TooLate":      "太晚",

		"TooNear":    "太近",
		"TooFar":     "太远",
		"WrongRange": "区间错误",

		"NotIntRange":    "非int区间",
		"NotInt64Range":  "非int64区间",
		"NotUintRange":   "非uint区间",
		"NotUint64Range": "非uint64区间",
		"LeftTooSmall":   "区间左值太小",
		"LeftTooLarge":   "区间左值太大",
		"RightTooSmall":  "区间右值太小",
		"RightTooLarge":  "区间右值太大",

		"NotTimestampRange": "非时间戳区间",
		"NotTimeRange":      "非时间区间",
		"LeftTooEarly":      "区间左值太早",
		"LeftTooLate":       "区间左值太晚",
		"RightTooEarly":     "区间右值太早",
		"RightTooLate":      "区间右值太晚",

		"TooFew":  "太少",
		"TooMany": "太多",

		"NotIntSet":    "非int集合",
		"NotInt64Set":  "非int64集合",
		"NotUintSet":   "非uint集合",
		"NotUint64Set": "非uint64集合",
		"ItemTooSmall": "集合中元素值太小",
		"ItemTooLarge": "集合中元素值太大",

		"NotStringSet":        "非字符串集合",
		"ItemTooShort":        "集合中字符串太短",
		"ItemTooLong":         "集合中字符串太长",
		"ItemNotNumeric":      "集合中字符串不是数值",
		"ItemNotDigit":        "集合中字符串不是纯数字组成",
		"ItemNotAlpha":        "集合中字符串不是纯字母组成",
		"ItemNotAlphaNumeric": "集合中字符串不是由纯字母和数字组成",
		"ItemWrongFormat":     "集合中字符串格式错误",

		"NotEmailSet": "非邮箱地址集合",

		"NotCIDRSet":  "非CIDR集合",
		"NotIPSet":    "非IP地址集合",
		"ItemNotIPv4": "集合中的元素不是IPv4",
		"ItemNotIPv6": "集合中的元素不是IPv6",
	},
}

Functions

This section is empty.

Types

type CIDRAddr

type CIDRAddr struct {
	IP        net.IP
	IPNet     *net.IPNet
	RawString string
}

func (*CIDRAddr) String

func (cidr *CIDRAddr) String() string

type CIDRFilter

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

func CIDR

func CIDR() *CIDRFilter

CIDR return a CIDR filter.

func (*CIDRFilter) AddValidator

func (f *CIDRFilter) AddValidator(validator CIDRValidator) *CIDRFilter

AddValidator add a custom validator to filter

func (*CIDRFilter) Allow

func (f *CIDRFilter) Allow(vals ...string) *CIDRFilter

Allow allow value is a string in the specified list

func (*CIDRFilter) IsIPv4

func (f *CIDRFilter) IsIPv4() *CIDRFilter

IsIPv4 valid whether cidr is ipv4 cidr.

func (*CIDRFilter) IsIPv6

func (f *CIDRFilter) IsIPv6() *CIDRFilter

IsIPv6 valid whether cidr is ipv6 cidr.

func (*CIDRFilter) Run

func (f *CIDRFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*CIDRFilter) ToString

func (f *CIDRFilter) ToString() *CIDRFilter

ToString return value as string

type CIDRSetFilter

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

func CIDRSet

func CIDRSet() *CIDRSetFilter

CIDRSet return a CIDRSet filter.

func (*CIDRSetFilter) AddValidator

func (f *CIDRSetFilter) AddValidator(validator CIDRSetValidator) *CIDRSetFilter

AddValidator add a custom validator to filter

func (*CIDRSetFilter) Allow

func (f *CIDRSetFilter) Allow(vals ...string) *CIDRSetFilter

Allow allow value is a string in the specified list

func (*CIDRSetFilter) Delimiter

func (f *CIDRSetFilter) Delimiter(delimiter string) *CIDRSetFilter

Delimiter set the delimiter of set string.

func (*CIDRSetFilter) ItemIsIPv4

func (f *CIDRSetFilter) ItemIsIPv4() *CIDRSetFilter

ItemIsIPv4 valid whether cidr is ipv4 cidr.

func (*CIDRSetFilter) ItemIsIPv6

func (f *CIDRSetFilter) ItemIsIPv6() *CIDRSetFilter

ItemIsIPv6 valid whether cidr is ipv6 cidr.

func (*CIDRSetFilter) MaxCount

func (f *CIDRSetFilter) MaxCount(count int) *CIDRSetFilter

MaxCount set the max item count of set.

func (*CIDRSetFilter) MinCount

func (f *CIDRSetFilter) MinCount(count int) *CIDRSetFilter

MinCount set the max item count of set.

func (*CIDRSetFilter) Run

func (f *CIDRSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type CIDRSetValidator

type CIDRSetValidator func(paramName string, paramValue []*CIDRAddr) *Error

type CIDRValidator

type CIDRValidator func(paramName string, paramValue *CIDRAddr) *Error

type DefaultFilter

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

func Default

func Default(defaultVal interface{}) *DefaultFilter

Default return a default filter.

func (*DefaultFilter) Run

func (f *DefaultFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type EmailFilter

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

func Email

func Email() *EmailFilter

Email return a email filter.

func (*EmailFilter) AddValidator

func (f *EmailFilter) AddValidator(validator EmailValidator) *EmailFilter

AddValidator add a custom validator to filter

func (*EmailFilter) Allow

func (f *EmailFilter) Allow(vals ...string) *EmailFilter

Allow allow value is a string in the specified list

func (*EmailFilter) Between

func (f *EmailFilter) Between(minLength, maxLength int) *EmailFilter

Between valid whether string's length is in the range.

func (*EmailFilter) Domain

func (f *EmailFilter) Domain(domain string) *EmailFilter

Domain valid whether email is end with specified domain.

func (*EmailFilter) KeepCase

func (f *EmailFilter) KeepCase() *EmailFilter

KeepCase do no case transform before validation.

func (*EmailFilter) LongerThan

func (f *EmailFilter) LongerThan(length int) *EmailFilter

LongerThan valid whether string is longer than the specified length.

func (*EmailFilter) MaxLen

func (f *EmailFilter) MaxLen(length int) *EmailFilter

MaxLen valid whether string is not shorter than the specified length.

func (*EmailFilter) MinLen

func (f *EmailFilter) MinLen(length int) *EmailFilter

MinLen valid whether string is not longer than the specified length.

func (*EmailFilter) Run

func (f *EmailFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*EmailFilter) ShorterThan

func (f *EmailFilter) ShorterThan(length int) *EmailFilter

ShorterThan valid whether string is shorter than the specified length.

func (*EmailFilter) ToLower

func (f *EmailFilter) ToLower() *EmailFilter

ToLower lower case string before validation.

func (*EmailFilter) ToUpper

func (f *EmailFilter) ToUpper() *EmailFilter

ToUpper lower case string before validation.

type EmailSetFilter

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

func EmailSet

func EmailSet() *EmailSetFilter

EmailSet return a email set filter.

func (*EmailSetFilter) AddValidator

func (f *EmailSetFilter) AddValidator(validator EmailSetValidator) *EmailSetFilter

AddValidator add a custom validator to filter

func (*EmailSetFilter) Allow

func (f *EmailSetFilter) Allow(vals ...string) *EmailSetFilter

Allow allow value is a string in the specified list

func (*EmailSetFilter) Delimiter

func (f *EmailSetFilter) Delimiter(delimiter string) *EmailSetFilter

Delimiter set the delimiter of set string.

func (*EmailSetFilter) ItemBetween

func (f *EmailSetFilter) ItemBetween(minLength, maxLength int) *EmailSetFilter

Between valid whether length of string in set is in the range.

func (*EmailSetFilter) ItemDomain

func (f *EmailSetFilter) ItemDomain(domain string) *EmailSetFilter

ItemDomain valid whether email is end with specified domain.

func (*EmailSetFilter) ItemLongerThan

func (f *EmailSetFilter) ItemLongerThan(length int) *EmailSetFilter

LongerThan valid whether string in set longer than the specified length.

func (*EmailSetFilter) ItemMaxLen

func (f *EmailSetFilter) ItemMaxLen(length int) *EmailSetFilter

MaxLen valid whether string in set not shorter than the specified length.

func (*EmailSetFilter) ItemMinLen

func (f *EmailSetFilter) ItemMinLen(length int) *EmailSetFilter

MinLen valid whether string in set not longer than the specified length.

func (*EmailSetFilter) ItemShorterThan

func (f *EmailSetFilter) ItemShorterThan(length int) *EmailSetFilter

ShorterThan valid whether string in set shorter than the specified length.

func (*EmailSetFilter) KeepCase

func (f *EmailSetFilter) KeepCase() *EmailSetFilter

KeepCase do no case transform before validation.

func (*EmailSetFilter) MaxCount

func (f *EmailSetFilter) MaxCount(count int) *EmailSetFilter

MaxCount set the max item count of set.

func (*EmailSetFilter) MinCount

func (f *EmailSetFilter) MinCount(count int) *EmailSetFilter

MinCount set the max item count of set.

func (*EmailSetFilter) Run

func (f *EmailSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*EmailSetFilter) ToLower

func (f *EmailSetFilter) ToLower() *EmailSetFilter

ToLower lower case string before validation.

func (*EmailSetFilter) ToUpper

func (f *EmailSetFilter) ToUpper() *EmailSetFilter

ToUpper lower case string before validation.

type EmailSetValidator

type EmailSetValidator func(paramName string, paramValue []string) *Error

type EmailValidator

type EmailValidator func(paramName string, paramValue string) *Error

type EmptyToNilFilter

type EmptyToNilFilter struct {
}

func EmptyToNil

func EmptyToNil() *EmptyToNilFilter

EmptyToNil return a empty to nil filter.

func (*EmptyToNilFilter) Run

func (f *EmptyToNilFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Error

type Error struct {
	Type   ErrorType
	Fields []string
}

func NewError

func NewError(errorType ErrorType, fields ...string) *Error

NewError return a filter error.

func (*Error) Error

func (e *Error) Error() string

type ErrorType

type ErrorType uint

type Filter

type Filter interface {
	Run(paramName string, paramValue interface{}) (interface{}, *Error)
}

type Float32Filter

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

func Float32

func Float32() *Float32Filter

Float32 return a float32 filter.

func (*Float32Filter) AddValidator

func (f *Float32Filter) AddValidator(validator Float32Validator) *Float32Filter

AddValidator add a custom validator to filter

func (*Float32Filter) Allow

func (f *Float32Filter) Allow(vals ...string) *Float32Filter

Allow allow value is a string in the specified list

func (*Float32Filter) Between

func (f *Float32Filter) Between(min, max float32) *Float32Filter

Between valid param value should in the specified range.

func (*Float32Filter) DecimalPlace

func (f *Float32Filter) DecimalPlace(length int) *Float32Filter

DecimalPlace valid whether decimal place is equal to the specified length.

func (*Float32Filter) Equal

func (f *Float32Filter) Equal(val float32) *Float32Filter

Equal valid param value should be equal to the specified value.

func (*Float32Filter) In

func (f *Float32Filter) In(set []float32) *Float32Filter

In valid param value should in the specified set.

func (*Float32Filter) LargerThan

func (f *Float32Filter) LargerThan(val float32) *Float32Filter

LargerThan valid param value should be larger than the specified value.

func (*Float32Filter) Max

func (f *Float32Filter) Max(val float32) *Float32Filter

Max valid param value should not be larger than the specified value.

func (*Float32Filter) Min

func (f *Float32Filter) Min(val float32) *Float32Filter

Min valid param value should not be smaller than the specified value.

func (*Float32Filter) Run

func (f *Float32Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Float32Filter) SmallerThan

func (f *Float32Filter) SmallerThan(val float32) *Float32Filter

SmallerThan valid param value should be smaller than the specified value.

type Float32Validator

type Float32Validator func(paramName string, paramValue float32) *Error

type Float64Filter

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

func Float64

func Float64() *Float64Filter

Float64 return a float64 filter.

func (*Float64Filter) AddValidator

func (f *Float64Filter) AddValidator(validator Float64Validator) *Float64Filter

AddValidator add a custom validator to filter

func (*Float64Filter) Allow

func (f *Float64Filter) Allow(vals ...string) *Float64Filter

Allow allow value is a string in the specified list

func (*Float64Filter) Between

func (f *Float64Filter) Between(min, max float64) *Float64Filter

Between valid param value should in the specified range.

func (*Float64Filter) DecimalPlace

func (f *Float64Filter) DecimalPlace(length int) *Float64Filter

DecimalPlace valid whether decimal place is equal to the specified length.

func (*Float64Filter) Equal

func (f *Float64Filter) Equal(val float64) *Float64Filter

Equal valid param value should be equal to the specified value.

func (*Float64Filter) In

func (f *Float64Filter) In(set []float64) *Float64Filter

In valid param value should in the specified set.

func (*Float64Filter) LargerThan

func (f *Float64Filter) LargerThan(val float64) *Float64Filter

LargerThan valid param value should be larger than the specified value.

func (*Float64Filter) Max

func (f *Float64Filter) Max(val float64) *Float64Filter

Max valid param value should not be larger than the specified value.

func (*Float64Filter) Min

func (f *Float64Filter) Min(val float64) *Float64Filter

Min valid param value should not be smaller than the specified value.

func (*Float64Filter) Run

func (f *Float64Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Float64Filter) SmallerThan

func (f *Float64Filter) SmallerThan(val float64) *Float64Filter

SmallerThan valid param value should be smaller than the specified value.

type Float64Validator

type Float64Validator func(paramName string, paramValue float64) *Error

type IPFilter

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

func IP

func IP() *IPFilter

IP return a IP filter.

func (*IPFilter) AddValidator

func (f *IPFilter) AddValidator(validator IPValidator) *IPFilter

AddValidator add a custom validator to filter

func (*IPFilter) Allow

func (f *IPFilter) Allow(vals ...string) *IPFilter

Allow allow value is a string in the specified list

func (*IPFilter) IsIPv4

func (f *IPFilter) IsIPv4() *IPFilter

IsIPv4 valid whether ip address is ipv4 address.

func (*IPFilter) IsIPv6

func (f *IPFilter) IsIPv6() *IPFilter

IsIPv6 valid whether ip address is ipv6 address.

func (*IPFilter) Run

func (f *IPFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*IPFilter) ToString

func (f *IPFilter) ToString() *IPFilter

ToString return value as string

type IPSetFilter

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

func IPSet

func IPSet() *IPSetFilter

IPSet return a IPSet filter.

func (*IPSetFilter) AddValidator

func (f *IPSetFilter) AddValidator(validator IPSetValidator) *IPSetFilter

AddValidator add a custom validator to filter

func (*IPSetFilter) Allow

func (f *IPSetFilter) Allow(vals ...string) *IPSetFilter

Allow allow value is a string in the specified list

func (*IPSetFilter) Delimiter

func (f *IPSetFilter) Delimiter(delimiter string) *IPSetFilter

Delimiter set the delimiter of set string.

func (*IPSetFilter) ItemIsIPv4

func (f *IPSetFilter) ItemIsIPv4() *IPSetFilter

ItemIsIPv4 valid whether ip address in set is ipv4 address.

func (*IPSetFilter) ItemIsIPv6

func (f *IPSetFilter) ItemIsIPv6() *IPSetFilter

ItemIsIPv6 valid whether ip address in set is ipv6 address.

func (*IPSetFilter) ItemToString

func (f *IPSetFilter) ItemToString() *IPSetFilter

ItemToString return value as string

func (*IPSetFilter) MaxCount

func (f *IPSetFilter) MaxCount(count int) *IPSetFilter

MaxCount set the max item count of set.

func (*IPSetFilter) MinCount

func (f *IPSetFilter) MinCount(count int) *IPSetFilter

MinCount set the max item count of set.

func (*IPSetFilter) Run

func (f *IPSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type IPSetValidator

type IPSetValidator func(paramName string, paramValue []net.IP) *Error

type IPValidator

type IPValidator func(paramName string, paramValue *net.IP) *Error

type Int32Filter

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

func Int32

func Int32() *Int32Filter

Int32 return a int32 filter.

func (*Int32Filter) AddValidator

func (f *Int32Filter) AddValidator(validator Int32Validator) *Int32Filter

AddValidator add a custom validator to filter

func (*Int32Filter) Allow

func (f *Int32Filter) Allow(vals ...string) *Int32Filter

Allow allow value is a string in the specified list

func (*Int32Filter) Base

func (f *Int32Filter) Base(base int) *Int32Filter

Base set the base of int32. Int32Filter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Int32Filter) Between

func (f *Int32Filter) Between(min, max int32) *Int32Filter

Between valid param value should in the specified range.

func (*Int32Filter) Equal

func (f *Int32Filter) Equal(val int32) *Int32Filter

Equal valid param value should be equal to the specified value.

func (*Int32Filter) In

func (f *Int32Filter) In(set []int32) *Int32Filter

In valid param value should in the specified set.

func (*Int32Filter) LargerThan

func (f *Int32Filter) LargerThan(val int32) *Int32Filter

LargerThan valid param value should be larger than the specified value.

func (*Int32Filter) Max

func (f *Int32Filter) Max(val int32) *Int32Filter

Max valid param value should not be larger than the specified value.

func (*Int32Filter) Min

func (f *Int32Filter) Min(val int32) *Int32Filter

Min valid param value should not be smaller than the specified value.

func (*Int32Filter) Run

func (f *Int32Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Int32Filter) SmallerThan

func (f *Int32Filter) SmallerThan(val int32) *Int32Filter

SmallerThan valid param value should be smaller than the specified value.

type Int32RangeFilter

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

func Int32Range

func Int32Range() *Int32RangeFilter

Int32Range return a int32 range filter.

func (*Int32RangeFilter) AddValidator

func (f *Int32RangeFilter) AddValidator(validator Int32RangeValidator) *Int32RangeFilter

AddValidator add a custom validator to filter

func (*Int32RangeFilter) Allow

func (f *Int32RangeFilter) Allow(vals ...string) *Int32RangeFilter

Allow allow value is a string in the specified list

func (*Int32RangeFilter) LeftBetween

func (f *Int32RangeFilter) LeftBetween(min, max int32) *Int32RangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*Int32RangeFilter) LeftDefault

func (f *Int32RangeFilter) LeftDefault(val int32) *Int32RangeFilter

LeftDefault set the default left value of range if not specified.

func (*Int32RangeFilter) LeftEqual

func (f *Int32RangeFilter) LeftEqual(val int32) *Int32RangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*Int32RangeFilter) LeftLargerThan

func (f *Int32RangeFilter) LeftLargerThan(val int32) *Int32RangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*Int32RangeFilter) LeftMax

func (f *Int32RangeFilter) LeftMax(val int32) *Int32RangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*Int32RangeFilter) LeftMin

func (f *Int32RangeFilter) LeftMin(val int32) *Int32RangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*Int32RangeFilter) LeftSmallerThan

func (f *Int32RangeFilter) LeftSmallerThan(val int32) *Int32RangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*Int32RangeFilter) MaxDistance

func (f *Int32RangeFilter) MaxDistance(val uint) *Int32RangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*Int32RangeFilter) MinDistance

func (f *Int32RangeFilter) MinDistance(val uint) *Int32RangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*Int32RangeFilter) RightBetween

func (f *Int32RangeFilter) RightBetween(min, max int32) *Int32RangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*Int32RangeFilter) RightDefault

func (f *Int32RangeFilter) RightDefault(val int32) *Int32RangeFilter

RightDefault set the default right value of range if not specified.

func (*Int32RangeFilter) RightEqual

func (f *Int32RangeFilter) RightEqual(val int32) *Int32RangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*Int32RangeFilter) RightLargerThan

func (f *Int32RangeFilter) RightLargerThan(val int32) *Int32RangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*Int32RangeFilter) RightMax

func (f *Int32RangeFilter) RightMax(val int32) *Int32RangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*Int32RangeFilter) RightMin

func (f *Int32RangeFilter) RightMin(val int32) *Int32RangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*Int32RangeFilter) RightSmallerThan

func (f *Int32RangeFilter) RightSmallerThan(val int32) *Int32RangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*Int32RangeFilter) Run

func (f *Int32RangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Int32RangeValidator

type Int32RangeValidator func(paramName string, paramValue *types.Int32Range) *Error

type Int32SetFilter

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

func Int32Set

func Int32Set() *Int32SetFilter

Int32Set return a int32 set filter.

func (*Int32SetFilter) AddValidator

func (f *Int32SetFilter) AddValidator(validator Int32SetValidator) *Int32SetFilter

AddValidator add a custom validator to filter

func (*Int32SetFilter) Allow

func (f *Int32SetFilter) Allow(vals ...string) *Int32SetFilter

Allow allow value is a string in the specified list

func (*Int32SetFilter) Base

func (f *Int32SetFilter) Base(base int) *Int32SetFilter

Base set the base of int32. Int32SetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Int32SetFilter) Delimiter

func (f *Int32SetFilter) Delimiter(delimiter string) *Int32SetFilter

Delimiter set the delimiter of set string.

func (*Int32SetFilter) ItemBetween

func (f *Int32SetFilter) ItemBetween(min, max int32) *Int32SetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*Int32SetFilter) ItemIn

func (f *Int32SetFilter) ItemIn(set []int32) *Int32SetFilter

ItemIn valid item value of set should in the specified set.

func (*Int32SetFilter) ItemLargerThan

func (f *Int32SetFilter) ItemLargerThan(val int32) *Int32SetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*Int32SetFilter) ItemMax

func (f *Int32SetFilter) ItemMax(val int32) *Int32SetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*Int32SetFilter) ItemMin

func (f *Int32SetFilter) ItemMin(val int32) *Int32SetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*Int32SetFilter) ItemSmallerThan

func (f *Int32SetFilter) ItemSmallerThan(val int32) *Int32SetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*Int32SetFilter) MaxCount

func (f *Int32SetFilter) MaxCount(count int) *Int32SetFilter

MaxCount set the max item count of set.

func (*Int32SetFilter) MinCount

func (f *Int32SetFilter) MinCount(count int) *Int32SetFilter

MinCount set the max item count of set.

func (*Int32SetFilter) Run

func (f *Int32SetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Int32SetValidator

type Int32SetValidator func(paramName string, paramValue []int32) *Error

type Int32Validator

type Int32Validator func(paramName string, paramValue int32) *Error

type Int64Filter

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

func Int64

func Int64() *Int64Filter

Int64 return a int64 filter.

func (*Int64Filter) AddValidator

func (f *Int64Filter) AddValidator(validator Int64Validator) *Int64Filter

AddValidator add a custom validator to filter

func (*Int64Filter) Allow

func (f *Int64Filter) Allow(vals ...string) *Int64Filter

Allow allow value is a string in the specified list

func (*Int64Filter) Base

func (f *Int64Filter) Base(base int) *Int64Filter

Base set the base of int64. Int64Filter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Int64Filter) Between

func (f *Int64Filter) Between(min, max int64) *Int64Filter

Between valid param value should in the specified range.

func (*Int64Filter) Equal

func (f *Int64Filter) Equal(val int64) *Int64Filter

Equal valid param value should be equal to the specified value.

func (*Int64Filter) In

func (f *Int64Filter) In(set []int64) *Int64Filter

In valid param value should in the specified set.

func (*Int64Filter) LargerThan

func (f *Int64Filter) LargerThan(val int64) *Int64Filter

LargerThan valid param value should be larger than the specified value.

func (*Int64Filter) Max

func (f *Int64Filter) Max(val int64) *Int64Filter

Max valid param value should not be larger than the specified value.

func (*Int64Filter) Min

func (f *Int64Filter) Min(val int64) *Int64Filter

Min valid param value should not be smaller than the specified value.

func (*Int64Filter) Run

func (f *Int64Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Int64Filter) SmallerThan

func (f *Int64Filter) SmallerThan(val int64) *Int64Filter

SmallerThan valid param value should be smaller than the specified value.

type Int64RangeFilter

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

func Int64Range

func Int64Range() *Int64RangeFilter

Int64Range return a int64 range filter.

func (*Int64RangeFilter) AddValidator

func (f *Int64RangeFilter) AddValidator(validator Int64RangeValidator) *Int64RangeFilter

AddValidator add a custom validator to filter

func (*Int64RangeFilter) Allow

func (f *Int64RangeFilter) Allow(vals ...string) *Int64RangeFilter

Allow allow value is a string in the specified list

func (*Int64RangeFilter) LeftBetween

func (f *Int64RangeFilter) LeftBetween(min, max int64) *Int64RangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*Int64RangeFilter) LeftDefault

func (f *Int64RangeFilter) LeftDefault(val int64) *Int64RangeFilter

LeftDefault set the default left value of range if not specified.

func (*Int64RangeFilter) LeftEqual

func (f *Int64RangeFilter) LeftEqual(val int64) *Int64RangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*Int64RangeFilter) LeftLargerThan

func (f *Int64RangeFilter) LeftLargerThan(val int64) *Int64RangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*Int64RangeFilter) LeftMax

func (f *Int64RangeFilter) LeftMax(val int64) *Int64RangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*Int64RangeFilter) LeftMin

func (f *Int64RangeFilter) LeftMin(val int64) *Int64RangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*Int64RangeFilter) LeftSmallerThan

func (f *Int64RangeFilter) LeftSmallerThan(val int64) *Int64RangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*Int64RangeFilter) MaxDistance

func (f *Int64RangeFilter) MaxDistance(val uint64) *Int64RangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*Int64RangeFilter) MinDistance

func (f *Int64RangeFilter) MinDistance(val uint64) *Int64RangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*Int64RangeFilter) RightBetween

func (f *Int64RangeFilter) RightBetween(min, max int64) *Int64RangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*Int64RangeFilter) RightDefault

func (f *Int64RangeFilter) RightDefault(val int64) *Int64RangeFilter

RightDefault set the default right value of range if not specified.

func (*Int64RangeFilter) RightEqual

func (f *Int64RangeFilter) RightEqual(val int64) *Int64RangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*Int64RangeFilter) RightLargerThan

func (f *Int64RangeFilter) RightLargerThan(val int64) *Int64RangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*Int64RangeFilter) RightMax

func (f *Int64RangeFilter) RightMax(val int64) *Int64RangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*Int64RangeFilter) RightMin

func (f *Int64RangeFilter) RightMin(val int64) *Int64RangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*Int64RangeFilter) RightSmallerThan

func (f *Int64RangeFilter) RightSmallerThan(val int64) *Int64RangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*Int64RangeFilter) Run

func (f *Int64RangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Int64RangeValidator

type Int64RangeValidator func(paramName string, paramValue *types.Int64Range) *Error

type Int64SetFilter

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

func Int64Set

func Int64Set() *Int64SetFilter

Int64Set return a int64 set filter.

func (*Int64SetFilter) AddValidator

func (f *Int64SetFilter) AddValidator(validator Int64SetValidator) *Int64SetFilter

AddValidator add a custom validator to filter

func (*Int64SetFilter) Allow

func (f *Int64SetFilter) Allow(vals ...string) *Int64SetFilter

Allow allow value is a string in the specified list

func (*Int64SetFilter) Base

func (f *Int64SetFilter) Base(base int) *Int64SetFilter

Base set the base of int64. Int64SetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Int64SetFilter) Delimiter

func (f *Int64SetFilter) Delimiter(delimiter string) *Int64SetFilter

Delimiter set the delimiter of set string.

func (*Int64SetFilter) ItemBetween

func (f *Int64SetFilter) ItemBetween(min, max int64) *Int64SetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*Int64SetFilter) ItemIn

func (f *Int64SetFilter) ItemIn(set []int64) *Int64SetFilter

ItemIn valid item value of set should in the specified set.

func (*Int64SetFilter) ItemLargerThan

func (f *Int64SetFilter) ItemLargerThan(val int64) *Int64SetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*Int64SetFilter) ItemMax

func (f *Int64SetFilter) ItemMax(val int64) *Int64SetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*Int64SetFilter) ItemMin

func (f *Int64SetFilter) ItemMin(val int64) *Int64SetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*Int64SetFilter) ItemSmallerThan

func (f *Int64SetFilter) ItemSmallerThan(val int64) *Int64SetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*Int64SetFilter) MaxCount

func (f *Int64SetFilter) MaxCount(count int) *Int64SetFilter

MaxCount set the max item count of set.

func (*Int64SetFilter) MinCount

func (f *Int64SetFilter) MinCount(count int) *Int64SetFilter

MinCount set the max item count of set.

func (*Int64SetFilter) Run

func (f *Int64SetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Int64SetValidator

type Int64SetValidator func(paramName string, paramValue []int64) *Error

type Int64Validator

type Int64Validator func(paramName string, paramValue int64) *Error

type IntFilter

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

func Int

func Int() *IntFilter

Int return a int filter.

func (*IntFilter) AddValidator

func (f *IntFilter) AddValidator(validator IntValidator) *IntFilter

AddValidator add a custom validator to filter

func (*IntFilter) Allow

func (f *IntFilter) Allow(vals ...string) *IntFilter

Allow allow value is a string in the specified list

func (*IntFilter) Base

func (f *IntFilter) Base(base int) *IntFilter

Base set the base of int. IntFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*IntFilter) Between

func (f *IntFilter) Between(min, max int) *IntFilter

Between valid param value should in the specified range.

func (*IntFilter) Equal

func (f *IntFilter) Equal(val int) *IntFilter

Equal valid param value should be equal to the specified value.

func (*IntFilter) In

func (f *IntFilter) In(set []int) *IntFilter

In valid param value should in the specified set.

func (*IntFilter) LargerThan

func (f *IntFilter) LargerThan(val int) *IntFilter

LargerThan valid param value should be larger than the specified value.

func (*IntFilter) Max

func (f *IntFilter) Max(val int) *IntFilter

Max valid param value should not be larger than the specified value.

func (*IntFilter) Min

func (f *IntFilter) Min(val int) *IntFilter

Min valid param value should not be smaller than the specified value.

func (*IntFilter) Run

func (f *IntFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*IntFilter) SmallerThan

func (f *IntFilter) SmallerThan(val int) *IntFilter

SmallerThan valid param value should be smaller than the specified value.

type IntRangeFilter

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

func IntRange

func IntRange() *IntRangeFilter

IntRange return a int range filter.

func (*IntRangeFilter) AddValidator

func (f *IntRangeFilter) AddValidator(validator IntRangeValidator) *IntRangeFilter

AddValidator add a custom validator to filter

func (*IntRangeFilter) Allow

func (f *IntRangeFilter) Allow(vals ...string) *IntRangeFilter

Allow allow value is a string in the specified list

func (*IntRangeFilter) LeftBetween

func (f *IntRangeFilter) LeftBetween(min, max int) *IntRangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*IntRangeFilter) LeftDefault

func (f *IntRangeFilter) LeftDefault(val int) *IntRangeFilter

LeftDefault set the default left value of range if not specified.

func (*IntRangeFilter) LeftEqual

func (f *IntRangeFilter) LeftEqual(val int) *IntRangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*IntRangeFilter) LeftLargerThan

func (f *IntRangeFilter) LeftLargerThan(val int) *IntRangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*IntRangeFilter) LeftMax

func (f *IntRangeFilter) LeftMax(val int) *IntRangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*IntRangeFilter) LeftMin

func (f *IntRangeFilter) LeftMin(val int) *IntRangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*IntRangeFilter) LeftSmallerThan

func (f *IntRangeFilter) LeftSmallerThan(val int) *IntRangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*IntRangeFilter) MaxDistance

func (f *IntRangeFilter) MaxDistance(val uint) *IntRangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*IntRangeFilter) MinDistance

func (f *IntRangeFilter) MinDistance(val uint) *IntRangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*IntRangeFilter) RightBetween

func (f *IntRangeFilter) RightBetween(min, max int) *IntRangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*IntRangeFilter) RightDefault

func (f *IntRangeFilter) RightDefault(val int) *IntRangeFilter

RightDefault set the default right value of range if not specified.

func (*IntRangeFilter) RightEqual

func (f *IntRangeFilter) RightEqual(val int) *IntRangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*IntRangeFilter) RightLargerThan

func (f *IntRangeFilter) RightLargerThan(val int) *IntRangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*IntRangeFilter) RightMax

func (f *IntRangeFilter) RightMax(val int) *IntRangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*IntRangeFilter) RightMin

func (f *IntRangeFilter) RightMin(val int) *IntRangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*IntRangeFilter) RightSmallerThan

func (f *IntRangeFilter) RightSmallerThan(val int) *IntRangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*IntRangeFilter) Run

func (f *IntRangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type IntRangeValidator

type IntRangeValidator func(paramName string, paramValue *types.IntRange) *Error

type IntSetFilter

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

func IntSet

func IntSet() *IntSetFilter

IntSet return a int set filter.

func (*IntSetFilter) AddValidator

func (f *IntSetFilter) AddValidator(validator IntSetValidator) *IntSetFilter

AddValidator add a custom validator to filter

func (*IntSetFilter) Allow

func (f *IntSetFilter) Allow(vals ...string) *IntSetFilter

Allow allow value is a string in the specified list

func (*IntSetFilter) Base

func (f *IntSetFilter) Base(base int) *IntSetFilter

Base set the base of int. IntSetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*IntSetFilter) Delimiter

func (f *IntSetFilter) Delimiter(delimiter string) *IntSetFilter

Delimiter set the delimiter of set string.

func (*IntSetFilter) ItemBetween

func (f *IntSetFilter) ItemBetween(min, max int) *IntSetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*IntSetFilter) ItemIn

func (f *IntSetFilter) ItemIn(set []int) *IntSetFilter

ItemIn valid item value of set should in the specified set.

func (*IntSetFilter) ItemLargerThan

func (f *IntSetFilter) ItemLargerThan(val int) *IntSetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*IntSetFilter) ItemMax

func (f *IntSetFilter) ItemMax(val int) *IntSetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*IntSetFilter) ItemMin

func (f *IntSetFilter) ItemMin(val int) *IntSetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*IntSetFilter) ItemSmallerThan

func (f *IntSetFilter) ItemSmallerThan(val int) *IntSetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*IntSetFilter) MaxCount

func (f *IntSetFilter) MaxCount(count int) *IntSetFilter

MaxCount set the max item count of set.

func (*IntSetFilter) MinCount

func (f *IntSetFilter) MinCount(count int) *IntSetFilter

MinCount set the max item count of set.

func (*IntSetFilter) Run

func (f *IntSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type IntSetValidator

type IntSetValidator func(paramName string, paramValue []int) *Error

type IntValidator

type IntValidator func(paramName string, paramValue int) *Error

type JsonFilter

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

func Json

func Json() *JsonFilter

Json return a json filter.

func (*JsonFilter) AddValidator

func (f *JsonFilter) AddValidator(validator JsonValidator) *JsonFilter

AddValidator add a custom validator to filter

func (*JsonFilter) Allow

func (f *JsonFilter) Allow(vals ...string) *JsonFilter

Allow allow value is a string in the specified list

func (*JsonFilter) Output

func (f *JsonFilter) Output(outVar interface{}) *JsonFilter

Output decode json value to specified variable.

func (*JsonFilter) Run

func (f *JsonFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*JsonFilter) ToString

func (f *JsonFilter) ToString() *JsonFilter

ToString return value as string

type JsonValidator

type JsonValidator func(paramName string, paramValue interface{}) *Error

type RequiredFilter

type RequiredFilter struct {
}

func Required

func Required() *RequiredFilter

Required return a require filter.

func (*RequiredFilter) Run

func (f *RequiredFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type StringFilter

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

func String

func String() *StringFilter

String return a string filter.

func (*StringFilter) AddValidator

func (f *StringFilter) AddValidator(validator StringValidator) *StringFilter

AddValidator add a custom validator to filter

func (*StringFilter) Allow

func (f *StringFilter) Allow(vals ...string) *StringFilter

Allow allow value is a string in the specified list

func (*StringFilter) Between

func (f *StringFilter) Between(minLength, maxLength int) *StringFilter

Between valid whether string's length is in the range.

func (*StringFilter) In

func (f *StringFilter) In(set []string) *StringFilter

In valid param value should in the specified set.

func (*StringFilter) IsAlpha

func (f *StringFilter) IsAlpha() *StringFilter

IsAlpha valid whether string is consist of alpha letters.

func (*StringFilter) IsAlphaNumeric

func (f *StringFilter) IsAlphaNumeric() *StringFilter

IsAlphaNumeric valid whether string is consist of alpha letters or digit numbers.

func (*StringFilter) IsDigit

func (f *StringFilter) IsDigit() *StringFilter

IsDigit valid whether string is consist of digit numbers.

func (*StringFilter) IsNumeric

func (f *StringFilter) IsNumeric() *StringFilter

IsNumeric valid whether string is numeric.

func (*StringFilter) KeepCase

func (f *StringFilter) KeepCase() *StringFilter

KeepCase do no case transform before validation.

func (*StringFilter) Length

func (f *StringFilter) Length(length int) *StringFilter

Length valid whether string's length is equal with the specified length.

func (*StringFilter) LongerThan

func (f *StringFilter) LongerThan(length int) *StringFilter

LongerThan valid whether string is longer than the specified length.

func (*StringFilter) Match

func (f *StringFilter) Match(pattern string) *StringFilter

Match valid whether string is match the specified regular expression.

func (*StringFilter) MaxLen

func (f *StringFilter) MaxLen(length int) *StringFilter

MaxLen valid whether string is not shorter than the specified length.

func (*StringFilter) MinLen

func (f *StringFilter) MinLen(length int) *StringFilter

MinLen valid whether string is not longer than the specified length.

func (*StringFilter) Run

func (f *StringFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*StringFilter) ShorterThan

func (f *StringFilter) ShorterThan(length int) *StringFilter

ShorterThan valid whether string is shorter than the specified length.

func (*StringFilter) ToLower

func (f *StringFilter) ToLower() *StringFilter

ToLower lower case string before validation.

func (*StringFilter) ToUpper

func (f *StringFilter) ToUpper() *StringFilter

ToUpper lower case string before validation.

func (*StringFilter) Trim

func (f *StringFilter) Trim() *StringFilter

Trim trim empty char like space, \t, \n, \r before validation.

type StringSetFilter

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

func StringSet

func StringSet() *StringSetFilter

StringSet return a string set filter.

func (*StringSetFilter) AddValidator

func (f *StringSetFilter) AddValidator(validator StringSetValidator) *StringSetFilter

AddValidator add a custom validator to filter

func (*StringSetFilter) Allow

func (f *StringSetFilter) Allow(vals ...string) *StringSetFilter

Allow allow value is a string in the specified list

func (*StringSetFilter) Delimiter

func (f *StringSetFilter) Delimiter(delimiter string) *StringSetFilter

Delimiter set the delimiter of set string.

func (*StringSetFilter) ItemBetween

func (f *StringSetFilter) ItemBetween(minLength, maxLength int) *StringSetFilter

Between valid whether length of string in set is in the range.

func (*StringSetFilter) ItemIn

func (f *StringSetFilter) ItemIn(set []string) *StringSetFilter

In valid param value should in the specified set.

func (*StringSetFilter) ItemIsAlpha

func (f *StringSetFilter) ItemIsAlpha() *StringSetFilter

IsAlpha valid whether string in set is consist of alpha letters.

func (*StringSetFilter) ItemIsAlphaNumeric

func (f *StringSetFilter) ItemIsAlphaNumeric() *StringSetFilter

IsAlphaNumeric valid whether string in set is consist of alpha letters or digit numbers.

func (*StringSetFilter) ItemIsDigit

func (f *StringSetFilter) ItemIsDigit() *StringSetFilter

IsDigit valid whether string in set is consist of digit numbers.

func (*StringSetFilter) ItemIsNumeric

func (f *StringSetFilter) ItemIsNumeric() *StringSetFilter

IsNumeric valid whether string in set is numeric.

func (*StringSetFilter) ItemLength

func (f *StringSetFilter) ItemLength(length int) *StringSetFilter

Length valid whether string's length in set is equal with the specified length.

func (*StringSetFilter) ItemLongerThan

func (f *StringSetFilter) ItemLongerThan(length int) *StringSetFilter

LongerThan valid whether string in set is longer than the specified length.

func (*StringSetFilter) ItemMatch

func (f *StringSetFilter) ItemMatch(pattern string) *StringSetFilter

Match valid whether string in set is match the specified regular expression.

func (*StringSetFilter) ItemMaxLen

func (f *StringSetFilter) ItemMaxLen(length int) *StringSetFilter

MaxLen valid whether string in set is not shorter than the specified length.

func (*StringSetFilter) ItemMinLen

func (f *StringSetFilter) ItemMinLen(length int) *StringSetFilter

MinLen valid whether string in set is not longer than the specified length.

func (*StringSetFilter) ItemShorterThan

func (f *StringSetFilter) ItemShorterThan(length int) *StringSetFilter

ShorterThan valid whether string in set is shorter than the specified length.

func (*StringSetFilter) KeepCase

func (f *StringSetFilter) KeepCase() *StringSetFilter

KeepCase do no case transform before validation.

func (*StringSetFilter) MaxCount

func (f *StringSetFilter) MaxCount(count int) *StringSetFilter

MaxCount set the max item count of set.

func (*StringSetFilter) MinCount

func (f *StringSetFilter) MinCount(count int) *StringSetFilter

MinCount set the max item count of set.

func (*StringSetFilter) Run

func (f *StringSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*StringSetFilter) ToLower

func (f *StringSetFilter) ToLower() *StringSetFilter

ToLower lower case string before validation.

func (*StringSetFilter) ToUpper

func (f *StringSetFilter) ToUpper() *StringSetFilter

ToUpper lower case string before validation.

type StringSetValidator

type StringSetValidator func(paramName string, paramValue []string) *Error

type StringValidator

type StringValidator func(paramName string, paramValue string) *Error

type TimeFilter

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

func Time

func Time() *TimeFilter

Time return a time filter.

func (*TimeFilter) AddValidator

func (f *TimeFilter) AddValidator(validator TimeValidator) *TimeFilter

AddValidator add a custom validator to filter

func (*TimeFilter) After

func (f *TimeFilter) After(tm string) *TimeFilter

After valid whether after specified time.

func (*TimeFilter) Allow

func (f *TimeFilter) Allow(vals ...string) *TimeFilter

Allow allow value is a string in the specified list

func (*TimeFilter) Before

func (f *TimeFilter) Before(tm string) *TimeFilter

Before valid whether before specified time.

func (*TimeFilter) Between

func (f *TimeFilter) Between(startTime, endTime string) *TimeFilter

Between valid whether between two times.

func (*TimeFilter) EndTo

func (f *TimeFilter) EndTo(tm string) *TimeFilter

EndTo valid whether end to specified time.

func (*TimeFilter) Equal

func (f *TimeFilter) Equal(tm string) *TimeFilter

Equal valid whether equal to specified time.

func (*TimeFilter) HasTime

func (f *TimeFilter) HasTime() *TimeFilter

HasTime set the layout to include time.

func (*TimeFilter) Layout

func (f *TimeFilter) Layout(layout string) *TimeFilter

Layout set the time layout.

func (*TimeFilter) Run

func (f *TimeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*TimeFilter) StartFrom

func (f *TimeFilter) StartFrom(tm string) *TimeFilter

StartFrom valid whether start from specified time.

type TimeRangeFilter

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

func TimeRange

func TimeRange() *TimeRangeFilter

TimeRange return a timestamp range filter.

func (*TimeRangeFilter) AddValidator

func (f *TimeRangeFilter) AddValidator(validator TimeRangeValidator) *TimeRangeFilter

AddValidator add a custom validator to filter

func (*TimeRangeFilter) Allow

func (f *TimeRangeFilter) Allow(vals ...string) *TimeRangeFilter

Allow allow value is a string in the specified list

func (*TimeRangeFilter) HasTime

func (f *TimeRangeFilter) HasTime() *TimeRangeFilter

HasTime set the layout to include time.

func (*TimeRangeFilter) Layout

func (f *TimeRangeFilter) Layout(layout string) *TimeRangeFilter

Layout set the time layout.

func (*TimeRangeFilter) LeftAfter

func (f *TimeRangeFilter) LeftAfter(tm string) *TimeRangeFilter

LeftAfter valid whether left value of range is after specified time.

func (*TimeRangeFilter) LeftBefore

func (f *TimeRangeFilter) LeftBefore(tm string) *TimeRangeFilter

LeftBefore valid whether left value of range is before specified time.

func (*TimeRangeFilter) LeftBetween

func (f *TimeRangeFilter) LeftBetween(startTime, endTime string) *TimeRangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*TimeRangeFilter) LeftDefault

func (f *TimeRangeFilter) LeftDefault(tm string) *TimeRangeFilter

LeftDefault set the default left value of range if not specified.

func (*TimeRangeFilter) LeftEndTo

func (f *TimeRangeFilter) LeftEndTo(tm string) *TimeRangeFilter

LeftEndTo valid whether left value of range is end to specified time.

func (*TimeRangeFilter) LeftEqual

func (f *TimeRangeFilter) LeftEqual(tm string) *TimeRangeFilter

LeftEqual valid whether left value of range is equal to specified time.

func (*TimeRangeFilter) LeftStartFrom

func (f *TimeRangeFilter) LeftStartFrom(tm string) *TimeRangeFilter

LeftStartFrom valid whether left value of range is start from specified time.

func (*TimeRangeFilter) MaxDistance

func (f *TimeRangeFilter) MaxDistance(duration string) *TimeRangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*TimeRangeFilter) MinDistance

func (f *TimeRangeFilter) MinDistance(duration string) *TimeRangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*TimeRangeFilter) RightAfter

func (f *TimeRangeFilter) RightAfter(tm string) *TimeRangeFilter

RightAfter valid whether right value of range is after specified time.

func (*TimeRangeFilter) RightBefore

func (f *TimeRangeFilter) RightBefore(tm string) *TimeRangeFilter

RightBefore valid whether right value of range is before specified time.

func (*TimeRangeFilter) RightBetween

func (f *TimeRangeFilter) RightBetween(startTime, endTime string) *TimeRangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*TimeRangeFilter) RightDefault

func (f *TimeRangeFilter) RightDefault(tm string) *TimeRangeFilter

RightDefault set the default right value of range if not specified.

func (*TimeRangeFilter) RightEndTo

func (f *TimeRangeFilter) RightEndTo(tm string) *TimeRangeFilter

RightEndTo valid whether right value of range is end to specified time.

func (*TimeRangeFilter) RightEqual

func (f *TimeRangeFilter) RightEqual(tm string) *TimeRangeFilter

RightEqual valid whether right value of range is equal to specified time.

func (*TimeRangeFilter) RightStartFrom

func (f *TimeRangeFilter) RightStartFrom(tm string) *TimeRangeFilter

RightStartFrom valid whether right value of range is start from specified time.

func (*TimeRangeFilter) Run

func (f *TimeRangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type TimeRangeValidator

type TimeRangeValidator func(paramName string, paramValue *types.TimeRange) *Error

type TimeSetFilter

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

func TimeSet

func TimeSet() *TimeSetFilter

TimeSet return a timestamp range filter.

func (*TimeSetFilter) AddValidator

func (f *TimeSetFilter) AddValidator(validator TimeSetValidator) *TimeSetFilter

AddValidator add a custom validator to filter

func (*TimeSetFilter) Allow

func (f *TimeSetFilter) Allow(vals ...string) *TimeSetFilter

Allow allow value is a string in the specified list

func (*TimeSetFilter) Delimiter

func (f *TimeSetFilter) Delimiter(delimiter string) *TimeSetFilter

Delimiter set the delimiter in set string.

func (*TimeSetFilter) HasTime

func (f *TimeSetFilter) HasTime() *TimeSetFilter

HasTime set the layout to include time.

func (*TimeSetFilter) ItemAfter

func (f *TimeSetFilter) ItemAfter(tm string) *TimeSetFilter

ItemAfter valid whether left value in set is after specified time.

func (*TimeSetFilter) ItemBefore

func (f *TimeSetFilter) ItemBefore(tm string) *TimeSetFilter

ItemBefore valid whether left value in set is before specified time.

func (*TimeSetFilter) ItemBetween

func (f *TimeSetFilter) ItemBetween(startTime, endTime string) *TimeSetFilter

ItemBetween valid whether left value in set is in the specified range.

func (*TimeSetFilter) ItemEndTo

func (f *TimeSetFilter) ItemEndTo(tm string) *TimeSetFilter

ItemEndTo valid whether left value in set is end to specified time.

func (*TimeSetFilter) ItemStartFrom

func (f *TimeSetFilter) ItemStartFrom(tm string) *TimeSetFilter

ItemStartFrom valid whether left value in set is start from specified time.

func (*TimeSetFilter) Layout

func (f *TimeSetFilter) Layout(layout string) *TimeSetFilter

Layout set the time layout.

func (*TimeSetFilter) MaxCount

func (f *TimeSetFilter) MaxCount(count int) *TimeSetFilter

MaxCount set the max item count of set.

func (*TimeSetFilter) MinCount

func (f *TimeSetFilter) MinCount(count int) *TimeSetFilter

MinCount set the max item count of set.

func (*TimeSetFilter) Run

func (f *TimeSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type TimeSetValidator

type TimeSetValidator func(paramName string, paramValue []*time.Time) *Error

type TimeValidator

type TimeValidator func(paramName string, paramValue *time.Time) *Error

type TimestampFilter

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

func Timestamp

func Timestamp() *TimestampFilter

Timestamp return a timestamp filter.

func (*TimestampFilter) AddValidator

func (f *TimestampFilter) AddValidator(validator TimestampValidator) *TimestampFilter

AddValidator add a custom validator to filter

func (*TimestampFilter) After

func (f *TimestampFilter) After(val uint32) *TimestampFilter

After valid whether after specified time.

func (*TimestampFilter) Allow

func (f *TimestampFilter) Allow(vals ...string) *TimestampFilter

Allow allow value is a string in the specified list

func (*TimestampFilter) Before

func (f *TimestampFilter) Before(val uint32) *TimestampFilter

Before valid whether before specified time.

func (*TimestampFilter) Between

func (f *TimestampFilter) Between(start, end uint32) *TimestampFilter

Between valid whether between two times.

func (*TimestampFilter) EndTo

func (f *TimestampFilter) EndTo(val uint32) *TimestampFilter

StartFrom valid whether end to specified time.

func (*TimestampFilter) Equal

func (f *TimestampFilter) Equal(val uint32) *TimestampFilter

Equal valid whether equal to specified time.

func (*TimestampFilter) Run

func (f *TimestampFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*TimestampFilter) StartFrom

func (f *TimestampFilter) StartFrom(val uint32) *TimestampFilter

StartFrom valid whether start from specified time.

type TimestampRangeFilter

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

func TimestampRange

func TimestampRange() *TimestampRangeFilter

TimestampRange return a timestamp range filter.

func (*TimestampRangeFilter) AddValidator

AddValidator add a custom validator to filter

func (*TimestampRangeFilter) Allow

Allow allow value is a string in the specified list

func (*TimestampRangeFilter) LeftAfter

LeftAfter valid whether left value of range is after specified time.

func (*TimestampRangeFilter) LeftBefore

func (f *TimestampRangeFilter) LeftBefore(val uint32) *TimestampRangeFilter

LeftBefore valid whether left value of range is before specified time.

func (*TimestampRangeFilter) LeftBetween

func (f *TimestampRangeFilter) LeftBetween(start, end uint32) *TimestampRangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*TimestampRangeFilter) LeftDefault

func (f *TimestampRangeFilter) LeftDefault(val uint32) *TimestampRangeFilter

LeftDefault set the default left value of range if not specified.

func (*TimestampRangeFilter) LeftEndTo

LeftEndTo valid whether left value of range is end to specified time.

func (*TimestampRangeFilter) LeftEqual

LeftEqual valid whether left value of range is equal to specified time.

func (*TimestampRangeFilter) LeftStartFrom

func (f *TimestampRangeFilter) LeftStartFrom(val uint32) *TimestampRangeFilter

LeftStartFrom valid whether left value of range is start from specified time.

func (*TimestampRangeFilter) MaxDistance

func (f *TimestampRangeFilter) MaxDistance(val uint32) *TimestampRangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*TimestampRangeFilter) MinDistance

func (f *TimestampRangeFilter) MinDistance(val uint32) *TimestampRangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*TimestampRangeFilter) RightAfter

func (f *TimestampRangeFilter) RightAfter(val uint32) *TimestampRangeFilter

RightAfter valid whether right value of range is after specified time.

func (*TimestampRangeFilter) RightBefore

func (f *TimestampRangeFilter) RightBefore(val uint32) *TimestampRangeFilter

RightBefore valid whether right value of range is before specified time.

func (*TimestampRangeFilter) RightBetween

func (f *TimestampRangeFilter) RightBetween(start, end uint32) *TimestampRangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*TimestampRangeFilter) RightDefault

func (f *TimestampRangeFilter) RightDefault(val uint32) *TimestampRangeFilter

RightDefault set the default right value of range if not specified.

func (*TimestampRangeFilter) RightEndTo

func (f *TimestampRangeFilter) RightEndTo(val uint32) *TimestampRangeFilter

RightEndTo valid whether right value of range is end to specified time.

func (*TimestampRangeFilter) RightEqual

func (f *TimestampRangeFilter) RightEqual(val uint32) *TimestampRangeFilter

RightEqual valid whether right value of range is equal to specified time.

func (*TimestampRangeFilter) RightStartFrom

func (f *TimestampRangeFilter) RightStartFrom(val uint32) *TimestampRangeFilter

RightStartFrom valid whether right value of range is start from specified time.

func (*TimestampRangeFilter) Run

func (f *TimestampRangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type TimestampRangeValidator

type TimestampRangeValidator func(paramName string, paramValue *types.TimestampRange) *Error

type TimestampSetFilter

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

func TimestampSet

func TimestampSet() *TimestampSetFilter

TimestampSet return a timestamp range filter.

func (*TimestampSetFilter) AddValidator

func (f *TimestampSetFilter) AddValidator(validator TimestampSetValidator) *TimestampSetFilter

AddValidator add a custom validator to filter

func (*TimestampSetFilter) Allow

func (f *TimestampSetFilter) Allow(vals ...string) *TimestampSetFilter

Allow allow value is a string in the specified list

func (*TimestampSetFilter) Delimiter

func (f *TimestampSetFilter) Delimiter(delimiter string) *TimestampSetFilter

Delimiter set the delimiter of set string.

func (*TimestampSetFilter) ItemAfter

func (f *TimestampSetFilter) ItemAfter(val uint32) *TimestampSetFilter

ItemAfter valid whether item value in set is after specified time.

func (*TimestampSetFilter) ItemBefore

func (f *TimestampSetFilter) ItemBefore(val uint32) *TimestampSetFilter

ItemBefore valid whether item value in set is before specified time.

func (*TimestampSetFilter) ItemBetween

func (f *TimestampSetFilter) ItemBetween(start, end uint32) *TimestampSetFilter

ItemBetween valid whether item value in set is in the specified range.

func (*TimestampSetFilter) ItemEndTo

func (f *TimestampSetFilter) ItemEndTo(val uint32) *TimestampSetFilter

ItemEndTo valid whether item value in set is end to specified time.

func (*TimestampSetFilter) ItemStartFrom

func (f *TimestampSetFilter) ItemStartFrom(val uint32) *TimestampSetFilter

ItemStartFrom valid whether item value in set is start from specified time.

func (*TimestampSetFilter) MaxCount

func (f *TimestampSetFilter) MaxCount(count int) *TimestampSetFilter

MaxCount set the max item count of set.

func (*TimestampSetFilter) MinCount

func (f *TimestampSetFilter) MinCount(count int) *TimestampSetFilter

MinCount set the max item count of set.

func (*TimestampSetFilter) Run

func (f *TimestampSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type TimestampSetValidator

type TimestampSetValidator func(paramName string, paramValue []uint32) *Error

type TimestampValidator

type TimestampValidator func(paramName string, paramValue uint32) *Error

type Uint32Filter

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

func Uint32

func Uint32() *Uint32Filter

Uint32 return a uint32 filter.

func (*Uint32Filter) AddValidator

func (f *Uint32Filter) AddValidator(validator Uint32Validator) *Uint32Filter

AddValidator add a custom validator to filter

func (*Uint32Filter) Allow

func (f *Uint32Filter) Allow(vals ...string) *Uint32Filter

Allow allow value is a string in the specified list

func (*Uint32Filter) Base

func (f *Uint32Filter) Base(base int) *Uint32Filter

Base set the base of uint. Uint32Filter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Uint32Filter) Between

func (f *Uint32Filter) Between(min, max uint32) *Uint32Filter

Between valid param value should in the specified range.

func (*Uint32Filter) Equal

func (f *Uint32Filter) Equal(val uint32) *Uint32Filter

Equal valid param value should be equal to the specified value.

func (*Uint32Filter) In

func (f *Uint32Filter) In(set []uint32) *Uint32Filter

In valid param value should in the specified set.

func (*Uint32Filter) LargerThan

func (f *Uint32Filter) LargerThan(val uint32) *Uint32Filter

LargerThan valid param value should be larger than the specified value.

func (*Uint32Filter) Max

func (f *Uint32Filter) Max(val uint32) *Uint32Filter

Max valid param value should not be larger than the specified value.

func (*Uint32Filter) Min

func (f *Uint32Filter) Min(val uint32) *Uint32Filter

Min valid param value should not be smaller than the specified value.

func (*Uint32Filter) Run

func (f *Uint32Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Uint32Filter) SmallerThan

func (f *Uint32Filter) SmallerThan(val uint32) *Uint32Filter

SmallerThan valid param value should be smaller than the specified value.

type Uint32RangeFilter

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

func Uint32Range

func Uint32Range() *Uint32RangeFilter

Uint32Range return a uint32 range filter.

func (*Uint32RangeFilter) AddValidator

func (f *Uint32RangeFilter) AddValidator(validator Uint32RangeValidator) *Uint32RangeFilter

AddValidator add a custom validator to filter

func (*Uint32RangeFilter) Allow

func (f *Uint32RangeFilter) Allow(vals ...string) *Uint32RangeFilter

Allow allow value is a string in the specified list

func (*Uint32RangeFilter) LeftBetween

func (f *Uint32RangeFilter) LeftBetween(min, max uint32) *Uint32RangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*Uint32RangeFilter) LeftDefault

func (f *Uint32RangeFilter) LeftDefault(val uint32) *Uint32RangeFilter

LeftDefault set the default left value of range if not specified.

func (*Uint32RangeFilter) LeftEqual

func (f *Uint32RangeFilter) LeftEqual(val uint32) *Uint32RangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*Uint32RangeFilter) LeftLargerThan

func (f *Uint32RangeFilter) LeftLargerThan(val uint32) *Uint32RangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*Uint32RangeFilter) LeftMax

func (f *Uint32RangeFilter) LeftMax(val uint32) *Uint32RangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*Uint32RangeFilter) LeftMin

func (f *Uint32RangeFilter) LeftMin(val uint32) *Uint32RangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*Uint32RangeFilter) LeftSmallerThan

func (f *Uint32RangeFilter) LeftSmallerThan(val uint32) *Uint32RangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*Uint32RangeFilter) MaxDistance

func (f *Uint32RangeFilter) MaxDistance(val uint32) *Uint32RangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*Uint32RangeFilter) MinDistance

func (f *Uint32RangeFilter) MinDistance(val uint32) *Uint32RangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*Uint32RangeFilter) RightBetween

func (f *Uint32RangeFilter) RightBetween(min, max uint32) *Uint32RangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*Uint32RangeFilter) RightDefault

func (f *Uint32RangeFilter) RightDefault(val uint32) *Uint32RangeFilter

RightDefault set the default right value of range if not specified.

func (*Uint32RangeFilter) RightEqual

func (f *Uint32RangeFilter) RightEqual(val uint32) *Uint32RangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*Uint32RangeFilter) RightLargerThan

func (f *Uint32RangeFilter) RightLargerThan(val uint32) *Uint32RangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*Uint32RangeFilter) RightMax

func (f *Uint32RangeFilter) RightMax(val uint32) *Uint32RangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*Uint32RangeFilter) RightMin

func (f *Uint32RangeFilter) RightMin(val uint32) *Uint32RangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*Uint32RangeFilter) RightSmallerThan

func (f *Uint32RangeFilter) RightSmallerThan(val uint32) *Uint32RangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*Uint32RangeFilter) Run

func (f *Uint32RangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Uint32RangeValidator

type Uint32RangeValidator func(paramName string, paramValue *types.Uint32Range) *Error

type Uint32SetFilter

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

func Uint32Set

func Uint32Set() *Uint32SetFilter

Uint32Set return a uint64 set filter.

func (*Uint32SetFilter) AddValidator

func (f *Uint32SetFilter) AddValidator(validator Uint32SetValidator) *Uint32SetFilter

AddValidator add a custom validator to filter

func (*Uint32SetFilter) Allow

func (f *Uint32SetFilter) Allow(vals ...string) *Uint32SetFilter

Allow allow value is a string in the specified list

func (*Uint32SetFilter) Base

func (f *Uint32SetFilter) Base(base int) *Uint32SetFilter

Base set the base of uint64. Uint32SetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Uint32SetFilter) Delimiter

func (f *Uint32SetFilter) Delimiter(delimiter string) *Uint32SetFilter

Delimiter set the delimiter of set string.

func (*Uint32SetFilter) ItemBetween

func (f *Uint32SetFilter) ItemBetween(min, max uint32) *Uint32SetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*Uint32SetFilter) ItemIn

func (f *Uint32SetFilter) ItemIn(set []uint32) *Uint32SetFilter

ItemIn valid item value of set should in the specified set.

func (*Uint32SetFilter) ItemLargerThan

func (f *Uint32SetFilter) ItemLargerThan(val uint32) *Uint32SetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*Uint32SetFilter) ItemMax

func (f *Uint32SetFilter) ItemMax(val uint32) *Uint32SetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*Uint32SetFilter) ItemMin

func (f *Uint32SetFilter) ItemMin(val uint32) *Uint32SetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*Uint32SetFilter) ItemSmallerThan

func (f *Uint32SetFilter) ItemSmallerThan(val uint32) *Uint32SetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*Uint32SetFilter) MaxCount

func (f *Uint32SetFilter) MaxCount(count int) *Uint32SetFilter

MaxCount set the max item count of set.

func (*Uint32SetFilter) MinCount

func (f *Uint32SetFilter) MinCount(count int) *Uint32SetFilter

MinCount set the max item count of set.

func (*Uint32SetFilter) Run

func (f *Uint32SetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Uint32SetValidator

type Uint32SetValidator func(paramName string, paramValue []uint32) *Error

type Uint32Validator

type Uint32Validator func(paramName string, paramValue uint32) *Error

type Uint64Filter

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

func Uint64

func Uint64() *Uint64Filter

Uint64 return a uint64 filter.

func (*Uint64Filter) AddValidator

func (f *Uint64Filter) AddValidator(validator Uint64Validator) *Uint64Filter

AddValidator add a custom validator to filter

func (*Uint64Filter) Allow

func (f *Uint64Filter) Allow(vals ...string) *Uint64Filter

Allow allow value is a string in the specified list

func (*Uint64Filter) Base

func (f *Uint64Filter) Base(base int) *Uint64Filter

Base set the base of uint64. Uint64Filter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Uint64Filter) Between

func (f *Uint64Filter) Between(min, max uint64) *Uint64Filter

Between valid param value should in the specified range.

func (*Uint64Filter) Equal

func (f *Uint64Filter) Equal(val uint64) *Uint64Filter

Equal valid param value should be equal to the specified value.

func (*Uint64Filter) In

func (f *Uint64Filter) In(set []uint64) *Uint64Filter

In valid param value should in the specified set.

func (*Uint64Filter) LargerThan

func (f *Uint64Filter) LargerThan(val uint64) *Uint64Filter

LargerThan valid param value should be larger than the specified value.

func (*Uint64Filter) Max

func (f *Uint64Filter) Max(val uint64) *Uint64Filter

Max valid param value should not be larger than the specified value.

func (*Uint64Filter) Min

func (f *Uint64Filter) Min(val uint64) *Uint64Filter

Min valid param value should not be smaller than the specified value.

func (*Uint64Filter) Run

func (f *Uint64Filter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*Uint64Filter) SmallerThan

func (f *Uint64Filter) SmallerThan(val uint64) *Uint64Filter

SmallerThan valid param value should be smaller than the specified value.

type Uint64RangeFilter

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

func Uint64Range

func Uint64Range() *Uint64RangeFilter

Uint64Range return a int64 filter.

func (*Uint64RangeFilter) AddValidator

func (f *Uint64RangeFilter) AddValidator(validator Uint64RangeValidator) *Uint64RangeFilter

AddValidator add a custom validator to filter

func (*Uint64RangeFilter) Allow

func (f *Uint64RangeFilter) Allow(vals ...string) *Uint64RangeFilter

Allow allow value is a string in the specified list

func (*Uint64RangeFilter) LeftBetween

func (f *Uint64RangeFilter) LeftBetween(min, max uint64) *Uint64RangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*Uint64RangeFilter) LeftDefault

func (f *Uint64RangeFilter) LeftDefault(val uint64) *Uint64RangeFilter

LeftDefault set the default left value of range if not specified.

func (*Uint64RangeFilter) LeftEqual

func (f *Uint64RangeFilter) LeftEqual(val uint64) *Uint64RangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*Uint64RangeFilter) LeftLargerThan

func (f *Uint64RangeFilter) LeftLargerThan(val uint64) *Uint64RangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*Uint64RangeFilter) LeftMax

func (f *Uint64RangeFilter) LeftMax(val uint64) *Uint64RangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*Uint64RangeFilter) LeftMin

func (f *Uint64RangeFilter) LeftMin(val uint64) *Uint64RangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*Uint64RangeFilter) LeftSmallerThan

func (f *Uint64RangeFilter) LeftSmallerThan(val uint64) *Uint64RangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*Uint64RangeFilter) MaxDistance

func (f *Uint64RangeFilter) MaxDistance(val uint64) *Uint64RangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*Uint64RangeFilter) MinDistance

func (f *Uint64RangeFilter) MinDistance(val uint64) *Uint64RangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*Uint64RangeFilter) RightBetween

func (f *Uint64RangeFilter) RightBetween(min, max uint64) *Uint64RangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*Uint64RangeFilter) RightDefault

func (f *Uint64RangeFilter) RightDefault(val uint64) *Uint64RangeFilter

RightDefault set the default right value of range if not specified.

func (*Uint64RangeFilter) RightEqual

func (f *Uint64RangeFilter) RightEqual(val uint64) *Uint64RangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*Uint64RangeFilter) RightLargerThan

func (f *Uint64RangeFilter) RightLargerThan(val uint64) *Uint64RangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*Uint64RangeFilter) RightMax

func (f *Uint64RangeFilter) RightMax(val uint64) *Uint64RangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*Uint64RangeFilter) RightMin

func (f *Uint64RangeFilter) RightMin(val uint64) *Uint64RangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*Uint64RangeFilter) RightSmallerThan

func (f *Uint64RangeFilter) RightSmallerThan(val uint64) *Uint64RangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*Uint64RangeFilter) Run

func (f *Uint64RangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Uint64RangeValidator

type Uint64RangeValidator func(paramName string, paramValue *types.Uint64Range) *Error

type Uint64SetFilter

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

func Uint64Set

func Uint64Set() *Uint64SetFilter

Uint64Set return a uint64 set filter.

func (*Uint64SetFilter) AddValidator

func (f *Uint64SetFilter) AddValidator(validator Uint64SetValidator) *Uint64SetFilter

AddValidator add a custom validator to filter

func (*Uint64SetFilter) Allow

func (f *Uint64SetFilter) Allow(vals ...string) *Uint64SetFilter

Allow allow value is a string in the specified list

func (*Uint64SetFilter) Base

func (f *Uint64SetFilter) Base(base int) *Uint64SetFilter

Base set the base of uint64. Uint64SetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*Uint64SetFilter) Delimiter

func (f *Uint64SetFilter) Delimiter(delimiter string) *Uint64SetFilter

Delimiter set the delimiter of set string.

func (*Uint64SetFilter) ItemBetween

func (f *Uint64SetFilter) ItemBetween(min, max uint64) *Uint64SetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*Uint64SetFilter) ItemIn

func (f *Uint64SetFilter) ItemIn(set []uint64) *Uint64SetFilter

ItemIn valid item value of set should in the specified set.

func (*Uint64SetFilter) ItemLargerThan

func (f *Uint64SetFilter) ItemLargerThan(val uint64) *Uint64SetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*Uint64SetFilter) ItemMax

func (f *Uint64SetFilter) ItemMax(val uint64) *Uint64SetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*Uint64SetFilter) ItemMin

func (f *Uint64SetFilter) ItemMin(val uint64) *Uint64SetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*Uint64SetFilter) ItemSmallerThan

func (f *Uint64SetFilter) ItemSmallerThan(val uint64) *Uint64SetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*Uint64SetFilter) MaxCount

func (f *Uint64SetFilter) MaxCount(count int) *Uint64SetFilter

MaxCount set the max item count of set.

func (*Uint64SetFilter) MinCount

func (f *Uint64SetFilter) MinCount(count int) *Uint64SetFilter

MinCount set the max item count of set.

func (*Uint64SetFilter) Run

func (f *Uint64SetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type Uint64SetValidator

type Uint64SetValidator func(paramName string, paramValue []uint64) *Error

type Uint64Validator

type Uint64Validator func(paramName string, paramValue uint64) *Error

type UintFilter

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

func Uint

func Uint() *UintFilter

Uint return a uint filter.

func (*UintFilter) AddValidator

func (f *UintFilter) AddValidator(validator UintValidator) *UintFilter

AddValidator add a custom validator to filter

func (*UintFilter) Allow

func (f *UintFilter) Allow(vals ...string) *UintFilter

Allow allow value is a string in the specified list

func (*UintFilter) Base

func (f *UintFilter) Base(base int) *UintFilter

Base set the base of uint. UintFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*UintFilter) Between

func (f *UintFilter) Between(min, max uint) *UintFilter

Between valid param value should in the specified range.

func (*UintFilter) Equal

func (f *UintFilter) Equal(val uint) *UintFilter

Equal valid param value should be equal to the specified value.

func (*UintFilter) In

func (f *UintFilter) In(set []uint) *UintFilter

In valid param value should in the specified set.

func (*UintFilter) LargerThan

func (f *UintFilter) LargerThan(val uint) *UintFilter

LargerThan valid param value should be larger than the specified value.

func (*UintFilter) Max

func (f *UintFilter) Max(val uint) *UintFilter

Max valid param value should not be larger than the specified value.

func (*UintFilter) Min

func (f *UintFilter) Min(val uint) *UintFilter

Min valid param value should not be smaller than the specified value.

func (*UintFilter) Run

func (f *UintFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

func (*UintFilter) SmallerThan

func (f *UintFilter) SmallerThan(val uint) *UintFilter

SmallerThan valid param value should be smaller than the specified value.

type UintRangeFilter

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

func UintRange

func UintRange() *UintRangeFilter

UintRange return a uint range filter.

func (*UintRangeFilter) AddValidator

func (f *UintRangeFilter) AddValidator(validator UintRangeValidator) *UintRangeFilter

AddValidator add a custom validator to filter

func (*UintRangeFilter) Allow

func (f *UintRangeFilter) Allow(vals ...string) *UintRangeFilter

Allow allow value is a string in the specified list

func (*UintRangeFilter) LeftBetween

func (f *UintRangeFilter) LeftBetween(min, max uint) *UintRangeFilter

LeftBetween valid whether left value of range is in the specified range.

func (*UintRangeFilter) LeftDefault

func (f *UintRangeFilter) LeftDefault(val uint) *UintRangeFilter

LeftDefault set the default left value of range if not specified.

func (*UintRangeFilter) LeftEqual

func (f *UintRangeFilter) LeftEqual(val uint) *UintRangeFilter

LeftEqual valid whether left value of range is equal to the specified value.

func (*UintRangeFilter) LeftLargerThan

func (f *UintRangeFilter) LeftLargerThan(val uint) *UintRangeFilter

LeftLargerThan valid whether left value of range is larger than the specified value.

func (*UintRangeFilter) LeftMax

func (f *UintRangeFilter) LeftMax(val uint) *UintRangeFilter

LeftMax valid whether left value of range is not larger than specified value.

func (*UintRangeFilter) LeftMin

func (f *UintRangeFilter) LeftMin(val uint) *UintRangeFilter

LeftMin valid whether left value of range is not smaller than specified value.

func (*UintRangeFilter) LeftSmallerThan

func (f *UintRangeFilter) LeftSmallerThan(val uint) *UintRangeFilter

LeftSmallerThan valid whether left value of range is smaller than the specified value.

func (*UintRangeFilter) MaxDistance

func (f *UintRangeFilter) MaxDistance(val uint) *UintRangeFilter

MaxDistance valid whether the distance of range not larger than the specified value.

func (*UintRangeFilter) MinDistance

func (f *UintRangeFilter) MinDistance(val uint) *UintRangeFilter

MinDistance valid whether the distance of range not smaller than the specified value.

func (*UintRangeFilter) RightBetween

func (f *UintRangeFilter) RightBetween(min, max uint) *UintRangeFilter

RightBetween valid whether right value of range is in the specified range.

func (*UintRangeFilter) RightDefault

func (f *UintRangeFilter) RightDefault(val uint) *UintRangeFilter

RightDefault set the default right value of range if not specified.

func (*UintRangeFilter) RightEqual

func (f *UintRangeFilter) RightEqual(val uint) *UintRangeFilter

RightEqual valid whether right value of range is equal to the specified value.

func (*UintRangeFilter) RightLargerThan

func (f *UintRangeFilter) RightLargerThan(val uint) *UintRangeFilter

RightLargerThan valid whether right value of range is larger than the specified value.

func (*UintRangeFilter) RightMax

func (f *UintRangeFilter) RightMax(val uint) *UintRangeFilter

RightMax valid whether right value of range is not larger than specified value.

func (*UintRangeFilter) RightMin

func (f *UintRangeFilter) RightMin(val uint) *UintRangeFilter

RightMin valid whether right value of range is not smaller than specified value.

func (*UintRangeFilter) RightSmallerThan

func (f *UintRangeFilter) RightSmallerThan(val uint) *UintRangeFilter

RightSmallerThan valid whether right value of range is smaller than the specified value.

func (*UintRangeFilter) Run

func (f *UintRangeFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type UintRangeValidator

type UintRangeValidator func(paramName string, paramValue *types.UintRange) *Error

type UintSetFilter

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

func UintSet

func UintSet() *UintSetFilter

UintSet return a uint set filter.

func (*UintSetFilter) AddValidator

func (f *UintSetFilter) AddValidator(validator UintSetValidator) *UintSetFilter

AddValidator add a custom validator to filter

func (*UintSetFilter) Allow

func (f *UintSetFilter) Allow(vals ...string) *UintSetFilter

Allow allow value is a string in the specified list

func (*UintSetFilter) Base

func (f *UintSetFilter) Base(base int) *UintSetFilter

Base set the base of uint. UintSetFilter interprets a string s in the given base (2 to 36) and returns the corresponding value i. If base == 0, the base is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.

func (*UintSetFilter) Delimiter

func (f *UintSetFilter) Delimiter(delimiter string) *UintSetFilter

Delimiter set the delimiter of set string.

func (*UintSetFilter) ItemBetween

func (f *UintSetFilter) ItemBetween(min, max uint) *UintSetFilter

ItemBetween valid whether item value of set is in the specified set.

func (*UintSetFilter) ItemIn

func (f *UintSetFilter) ItemIn(set []uint) *UintSetFilter

ItemIn valid item value of set should in the specified set.

func (*UintSetFilter) ItemLargerThan

func (f *UintSetFilter) ItemLargerThan(val uint) *UintSetFilter

ItemLargerThan valid whether item value of set is larger than the specified value.

func (*UintSetFilter) ItemMax

func (f *UintSetFilter) ItemMax(val uint) *UintSetFilter

ItemMax valid whether item value of set is not larger than specified value.

func (*UintSetFilter) ItemMin

func (f *UintSetFilter) ItemMin(val uint) *UintSetFilter

ItemMin valid whether item value of set is not smaller than specified value.

func (*UintSetFilter) ItemSmallerThan

func (f *UintSetFilter) ItemSmallerThan(val uint) *UintSetFilter

ItemSmallerThan valid whether item value of set is smaller than the specified value.

func (*UintSetFilter) MaxCount

func (f *UintSetFilter) MaxCount(count int) *UintSetFilter

MaxCount set the max item count of set.

func (*UintSetFilter) MinCount

func (f *UintSetFilter) MinCount(count int) *UintSetFilter

MinCount set the max item count of set.

func (*UintSetFilter) Run

func (f *UintSetFilter) Run(paramName string, paramValue interface{}) (interface{}, *Error)

Run make the filter running.

type UintSetValidator

type UintSetValidator func(paramName string, paramValue []uint) *Error

type UintValidator

type UintValidator func(paramName string, paramValue uint) *Error

Jump to

Keyboard shortcuts

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