functions

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

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
	// 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
	// Unknown is the unknown argument type.
	Unknown
)

func (ArgType) String

func (typ ArgType) String() string

String returns the argument type as a string value.

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 represents 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 Fn

type Fn uint16

Fn is the type alias for function definitions.

const (
	// CIDRContains identifies the CIDR_CONTAINS function
	CIDRContainsFn Fn = iota + 1
	// MD5Fn represents the MD5 function
	MD5Fn
)

func (Fn) String

func (f Fn) String() string

String returns the function name in upper case.

type FunctionArgDesc

type FunctionArgDesc struct {
	Keyword  string
	Required bool
	Types    []ArgType
}

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
}

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 MD5

type MD5 struct{}

MD5 computes the MD5 hash of the given value.

func (MD5) Call

func (f MD5) Call(args []interface{}) (interface{}, bool)

func (MD5) Desc

func (f MD5) Desc() FunctionDesc

func (MD5) Name

func (f MD5) Name() Fn

Jump to

Keyboard shortcuts

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