modifiers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Comparators = map[string]Comparator{
	"contains":   contains{},
	"endswith":   endswith{},
	"startswith": startswith{},
	"re":         re{},
	"cidr":       cidr{},
	"gt":         gt{},
	"gte":        gte{},
	"lt":         lt{},
	"lte":        lte{},
}
View Source
var ComparatorsCaseSensitive = map[string]Comparator{
	"contains":   containsCS{},
	"endswith":   endswithCS{},
	"startswith": startswithCS{},
	"re":         re{},
	"cidr":       cidr{},
	"gt":         gt{},
	"gte":        gte{},
	"lt":         lt{},
	"lte":        lte{},
}
View Source
var ValueModifiers = map[string]ValueModifier{
	"base64": b64{},
	"wide":   wide{},
}

Functions

This section is empty.

Types

type Comparator

type Comparator interface {
	Alters(field any, value any) (string, error)
}

type ComparatorFunc

type ComparatorFunc func(field, value any) (string, error)

func GetComparator

func GetComparator(modifiers ...string) (ComparatorFunc, error)

func GetComparatorCaseSensitive

func GetComparatorCaseSensitive(modifiers ...string) (ComparatorFunc, error)

type ValueModifier

type ValueModifier interface {
	Modify(value any) (any, error)
}

ValueModifier modifies the expected value before it is passed to the comparator. For example, the `base64` modifier converts the expected value to base64.

Jump to

Keyboard shortcuts

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