Documentation ¶
Overview ¶
Package predicate provides predicate builders
Index ¶
- type Predicate
- func And[T any](p1, p2 Predicate[T]) Predicate[T]
- func Eq[T comparable](v T) Predicate[T]
- func Match[Entity, Property any](getter func(Entity) Property, condition Predicate[Property]) Predicate[Entity]
- func MatchAny[Entity, Property any](getter func(Entity) []Property, condition Predicate[Property]) Predicate[Entity]
- func Not[T any](p Predicate[T]) Predicate[T]
- func Or[T any](p1, p2 Predicate[T]) Predicate[T]
- func Union[T any](predicates ...Predicate[T]) Predicate[T]
- func Xor[T any](p1, p2 Predicate[T]) Predicate[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Predicate ¶
Predicate tests value (converts to true or false).
func Match ¶
func Match[Entity, Property any](getter func(Entity) Property, condition Predicate[Property]) Predicate[Entity]
Match creates a predicate that tests whether a value of a structure property matches a specified condition
func MatchAny ¶
func MatchAny[Entity, Property any](getter func(Entity) []Property, condition Predicate[Property]) Predicate[Entity]
MatchAny creates a predicate that tests whether any value of a structure property matches a specified condition The property has a slice type.
Directories ¶
Path | Synopsis |
---|---|
Package always provides constant predicate implementations
|
Package always provides constant predicate implementations |
Package eq provides predicate builder short aliases
|
Package eq provides predicate builder short aliases |
Package exclude provides predicate builders
|
Package exclude provides predicate builders |
Package less provides predicate builders
|
Package less provides predicate builders |
Package match provides short predicate constructors
|
Package match provides short predicate constructors |
Package more provides predicate builders
|
Package more provides predicate builders |
Package not provides negalive predicate builders like 'not equals to'
|
Package not provides negalive predicate builders like 'not equals to' |
Package one provides predicate builders
|
Package one provides predicate builders |
Package where provides short predicate constructors
|
Package where provides short predicate constructors |
Click to show internal directories.
Click to hide internal directories.