boolean

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextPredicate

type ContextPredicate[T any] func(context.Context, T) bool

ContextPredicate is a boolean function of a single argument and a context.

func ContextAnd

func ContextAnd[T any](predicates ...ContextPredicate[T]) ContextPredicate[T]

ContextAnd returns a predicate that is true if and only if all of the given predicates are true.

func ContextNot

func ContextNot[T any](p ContextPredicate[T]) ContextPredicate[T]

ContextNot returns the negation of the given predicate.

func ContextOr

func ContextOr[T any](predicates ...ContextPredicate[T]) ContextPredicate[T]

ContextOr returns a predicate that is true if and only if at least one of the given predicates is true.

func ParallelAnd

func ParallelAnd[T any](predicates ...ContextPredicate[T]) ContextPredicate[T]

ParallelAnd returns a predicate that is true if and only if all of the given predicates are true. The predicates are evaluated in parallel.

func ParallelOr

func ParallelOr[T any](predicates ...ContextPredicate[T]) ContextPredicate[T]

ParallelOr returns a predicate that is true if and only if at least one of the given predicates is true. The predicates are evaluated in parallel.

type Predicate

type Predicate[T any] func(T) bool

Predicate is a boolean function of a single argument.

func And

func And[T any](predicates ...Predicate[T]) Predicate[T]

And returns a predicate that is true if and only if all of the given predicates are true.

func Not

func Not[T any](p Predicate[T]) Predicate[T]

Not returns the negation of the given predicate.

func Or

func Or[T any](predicates ...Predicate[T]) Predicate[T]

Or returns a predicate that is true if and only if at least one of the given predicates is true.

Jump to

Keyboard shortcuts

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