filter

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 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 ComparisonOperation

type ComparisonOperation string
const (
	Equals        ComparisonOperation = "="
	NotEquals     ComparisonOperation = "!="
	LessThan      ComparisonOperation = "<"
	LessEquals    ComparisonOperation = "<="
	GreaterEquals ComparisonOperation = ">="
	GreaterThan   ComparisonOperation = ">"
)

type Filterer

type Filterer interface {
	And(other Filterer) *LogicalExpressions
	String() string
}

Filterer interface for both Term and LogicalExpressions.

type LogicalExpression

type LogicalExpression struct {
	Op     LogicalOperation
	Filter Filterer
}

LogicalExpression represents a pair of filter terms joined with a logical operator.

type LogicalExpressions

type LogicalExpressions struct {
	// contains filtered or unexported fields
}

LogicalExpressions represents a list of logical expressions.

func (*LogicalExpressions) And

func (*LogicalExpressions) String

func (le *LogicalExpressions) String() string

type LogicalOperation

type LogicalOperation string
const (
	And LogicalOperation = "AND"
)

type Term

type Term struct {
	// contains filtered or unexported fields
}

Term helps represent a single filter condition, e.g. "field = value".

func NewTerm

func NewTerm(field string, op ComparisonOperation, value interface{}) *Term

func (*Term) And

func (t *Term) And(other Filterer) *LogicalExpressions

func (*Term) String

func (t *Term) String() string

Jump to

Keyboard shortcuts

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