Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgType ¶
type ArgType uint8
ArgType is the type alias for the argument value type.
const ( // String represents the string argument type. String ArgType = iota // Number represents the scalar argument type. Number // IP represents the IP argument type. IP // Field represents the argument type that is derived // from the field literal. Field literal values can // be simple primitive types. Field // Func represents the argument type that is derived // from the function return value. Func // Slice represents the string slice argument type. Slice // Unknown is the unknown argument type. Unknown )
type ArgsValidation ¶ added in v1.5.0
ArgsValidation is a function for the custom argument validation logic.
type CIDRContains ¶
type CIDRContains struct{}
CIDRContains determines if the specified IP is contained within the block referenced by the given CIDR mask. The first argument in the slice represents the IP address and the rest of the args represent IP addresses in CIDR notation.
func (CIDRContains) Call ¶
func (f CIDRContains) Call(args []interface{}) (interface{}, bool)
func (CIDRContains) Desc ¶
func (f CIDRContains) Desc() FunctionDesc
func (CIDRContains) Name ¶
func (f CIDRContains) Name() Fn
type Concat ¶ added in v1.5.0
type Concat struct{}
Concat returns a concatenated string of all input arguments.
func (Concat) Desc ¶ added in v1.5.0
func (f Concat) Desc() FunctionDesc
type Entropy ¶ added in v1.5.0
type Entropy struct{}
Entropy measures the string entropy
func (Entropy) Desc ¶ added in v1.5.0
func (f Entropy) Desc() FunctionDesc
type Fn ¶
type Fn uint16
Fn is the type alias for function definitions.
const ( // CIDRContainsFn identifies the CIDR_CONTAINS function CIDRContainsFn Fn = iota + 1 // MD5Fn represents the MD5 function MD5Fn // ConcatFn represents the CONCAT function ConcatFn // LtrimFn represents the LTRIM function LtrimFn // RtrimFn represents the RTRIM function RtrimFn // LowerFn represents the LOWER function LowerFn // UpperFn represents the UPPER function UpperFn // ReplaceFn represents the REPLACE function ReplaceFn // SplitFn represents the SPLIT function SplitFn // LengthFn represents the LENGTH function LengthFn // IndexOfFn represents the INDEXOF function IndexOfFn // SubstrFn represents the SUBSTR function SubstrFn // EntropyFn represents the ENTROPY function EntropyFn // RegexFn represents the REGEX function RegexFn )
type FunctionArgDesc ¶
FunctionArgDesc described each function argument.
func (FunctionArgDesc) ContainsType ¶
func (arg FunctionArgDesc) ContainsType(typ ArgType) bool
ContainsType returns true if the argument satisfies the given argument type.
type FunctionDesc ¶
type FunctionDesc struct { Name Fn Args []FunctionArgDesc ArgsValidationFunc ArgsValidation }
FunctionDesc contains the function signature that particular filter function has to satisfy.
func (FunctionDesc) RequiredArgs ¶
func (f FunctionDesc) RequiredArgs() int
RequiredArgs returns the number of the required function args.
type IndexOf ¶ added in v1.5.0
type IndexOf struct{}
IndexOf returns the index of the instance of substring in a given string depending on the provided search order.
func (IndexOf) Desc ¶ added in v1.5.0
func (f IndexOf) Desc() FunctionDesc
type Length ¶ added in v1.5.0
type Length struct{}
Length returns the number of characters (runes) for string arguments and the size of the slice for slice arguments.
func (Length) Desc ¶ added in v1.5.0
func (f Length) Desc() FunctionDesc
type Lower ¶ added in v1.5.0
type Lower struct{}
Lower converts the string with all Unicode letters mapped to their lower case.
func (Lower) Desc ¶ added in v1.5.0
func (f Lower) Desc() FunctionDesc
type Ltrim ¶ added in v1.5.0
type Ltrim struct{}
Ltrim trims the specified prefix from a string.
func (Ltrim) Desc ¶ added in v1.5.0
func (f Ltrim) Desc() FunctionDesc
type MD5 ¶
type MD5 struct{}
MD5 computes the MD5 hash of the given value.
func (MD5) Desc ¶
func (f MD5) Desc() FunctionDesc
type Regex ¶ added in v1.5.0
type Regex struct {
// contains filtered or unexported fields
}
Regex applies single/multiple regular expressions on the provided string arguments.
func (Regex) Desc ¶ added in v1.5.0
func (f Regex) Desc() FunctionDesc
type Replace ¶ added in v1.5.0
type Replace struct{}
Replace replaces occurrences in the string as given by arbitrary old/new replacement pairs.
func (Replace) Desc ¶ added in v1.5.0
func (f Replace) Desc() FunctionDesc
type Rtrim ¶ added in v1.5.0
type Rtrim struct{}
Rtrim trims the specified suffix from a string.
func (Rtrim) Desc ¶ added in v1.5.0
func (f Rtrim) Desc() FunctionDesc
type Split ¶ added in v1.5.0
type Split struct{}
Split produces a slice of substrings separated by the given delimiter.
func (Split) Desc ¶ added in v1.5.0
func (f Split) Desc() FunctionDesc
type Substr ¶ added in v1.5.0
type Substr struct{}
Substr creates a substring of a given string.
func (Substr) Desc ¶ added in v1.5.0
func (f Substr) Desc() FunctionDesc