filter

package
v0.0.0-...-1825ddb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//OpAnd is a static def for AND Operand
	OpAnd string = "AND"
	//OpOr is a static def for OR Operand
	OpOr string = "OR"
)
View Source
const (
	//OpEq is a static def for EQ Operand
	OpEq  string = "EQ"
	OpGt  string = "GT"
	OpGte string = "GTE"
)
View Source
const (
	//OpNot is a static def for NOT Operand
	OpNot string = "NOT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompoundFilter

type CompoundFilter struct {
	Op      string   `json:"op"`
	Filters []Filter `json:"filters"`
}

CompoundFilter to use for a query

func AllOf

func AllOf(filters ...Filter) CompoundFilter

func And

func And(filters ...Filter) CompoundFilter

func AnyOf

func AnyOf(filters ...Filter) CompoundFilter

func OneOf

func OneOf(filters ...Filter) CompoundFilter

func Or

func Or(filters ...Filter) CompoundFilter

func (CompoundFilter) Add

func (fil CompoundFilter) Add(filters ...Filter) CompoundFilter

func (CompoundFilter) And

func (fil CompoundFilter) And(filters ...Filter) CompoundFilter

func (CompoundFilter) AndEqualTo

func (fil CompoundFilter) AndEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) AndGreaterThan

func (fil CompoundFilter) AndGreaterThan(field labels.Label, value string) CompoundFilter

func (CompoundFilter) AndGreaterThanOrEqualTo

func (fil CompoundFilter) AndGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) AndNotEqualTo

func (fil CompoundFilter) AndNotEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) AndNotGreaterThan

func (fil CompoundFilter) AndNotGreaterThan(field labels.Label, value string) CompoundFilter

func (CompoundFilter) AndNotGreaterThanOrEqualTo

func (fil CompoundFilter) AndNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) Not

func (fil CompoundFilter) Not() UnaryFilter

func (CompoundFilter) Or

func (fil CompoundFilter) Or(filters ...Filter) CompoundFilter

func (CompoundFilter) OrEqualTo

func (fil CompoundFilter) OrEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) OrGreaterThan

func (fil CompoundFilter) OrGreaterThan(field labels.Label, value string) CompoundFilter

func (CompoundFilter) OrGreaterThanOrEqualTo

func (fil CompoundFilter) OrGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) OrNotEqualTo

func (fil CompoundFilter) OrNotEqualTo(field labels.Label, value string) CompoundFilter

func (CompoundFilter) OrNotGreaterThan

func (fil CompoundFilter) OrNotGreaterThan(field labels.Label, value string) CompoundFilter

func (CompoundFilter) OrNotGreaterThanOrEqualTo

func (fil CompoundFilter) OrNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

type FieldFilter

type FieldFilter struct {
	Op    string       `json:"op"`
	Field labels.Label `json:"field,omitempty"`
	Value string       `json:"value"`
}

Filter structure

func EqualTo

func EqualTo(field labels.Label, value string) FieldFilter

func GreaterThan

func GreaterThan(field labels.Label, value string) FieldFilter

func GreaterThanOrEqualTo

func GreaterThanOrEqualTo(field labels.Label, value string) FieldFilter

func (FieldFilter) And

func (fil FieldFilter) And(filters ...Filter) CompoundFilter

func (FieldFilter) AndEqualTo

func (fil FieldFilter) AndEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) AndGreaterThan

func (fil FieldFilter) AndGreaterThan(field labels.Label, value string) CompoundFilter

func (FieldFilter) AndGreaterThanOrEqualTo

func (fil FieldFilter) AndGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) AndNotEqualTo

func (fil FieldFilter) AndNotEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) AndNotGreaterThan

func (fil FieldFilter) AndNotGreaterThan(field labels.Label, value string) CompoundFilter

func (FieldFilter) AndNotGreaterThanOrEqualTo

func (fil FieldFilter) AndNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) Not

func (fil FieldFilter) Not() UnaryFilter

func (FieldFilter) Or

func (fil FieldFilter) Or(filters ...Filter) CompoundFilter

func (FieldFilter) OrEqualTo

func (fil FieldFilter) OrEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) OrGreaterThan

func (fil FieldFilter) OrGreaterThan(field labels.Label, value string) CompoundFilter

func (FieldFilter) OrGreaterThanOrEqualTo

func (fil FieldFilter) OrGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) OrNotEqualTo

func (fil FieldFilter) OrNotEqualTo(field labels.Label, value string) CompoundFilter

func (FieldFilter) OrNotGreaterThan

func (fil FieldFilter) OrNotGreaterThan(field labels.Label, value string) CompoundFilter

func (FieldFilter) OrNotGreaterThanOrEqualTo

func (fil FieldFilter) OrNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

type Filter

type Filter interface {
	And(filters ...Filter) CompoundFilter
	AndEqualTo(field labels.Label, value string) CompoundFilter
	AndNotEqualTo(field labels.Label, value string) CompoundFilter
	AndGreaterThan(field labels.Label, value string) CompoundFilter
	AndNotGreaterThan(field labels.Label, value string) CompoundFilter
	AndGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter
	AndNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter
	Or(filters ...Filter) CompoundFilter
	OrEqualTo(field labels.Label, value string) CompoundFilter
	OrNotEqualTo(field labels.Label, value string) CompoundFilter
	OrGreaterThan(field labels.Label, value string) CompoundFilter
	OrNotGreaterThan(field labels.Label, value string) CompoundFilter
	OrGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter
	OrNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter
}

type UnaryFilter

type UnaryFilter struct {
	Op        string `json:"op"`
	SubFilter Filter `json:"filter"`
}

func Not

func Not(filter Filter) UnaryFilter

func NotAnyOf

func NotAnyOf(filters ...Filter) UnaryFilter

func NotEqualTo

func NotEqualTo(field labels.Label, value string) UnaryFilter

func NotGreaterThan

func NotGreaterThan(field labels.Label, value string) UnaryFilter

func NotGreaterThanOrEqualTo

func NotGreaterThanOrEqualTo(field labels.Label, value string) UnaryFilter

func (UnaryFilter) And

func (fil UnaryFilter) And(filters ...Filter) CompoundFilter

func (UnaryFilter) AndEqualTo

func (fil UnaryFilter) AndEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) AndGreaterThan

func (fil UnaryFilter) AndGreaterThan(field labels.Label, value string) CompoundFilter

func (UnaryFilter) AndGreaterThanOrEqualTo

func (fil UnaryFilter) AndGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) AndNotEqualTo

func (fil UnaryFilter) AndNotEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) AndNotGreaterThan

func (fil UnaryFilter) AndNotGreaterThan(field labels.Label, value string) CompoundFilter

func (UnaryFilter) AndNotGreaterThanOrEqualTo

func (fil UnaryFilter) AndNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) Or

func (fil UnaryFilter) Or(filters ...Filter) CompoundFilter

func (UnaryFilter) OrEqualTo

func (fil UnaryFilter) OrEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) OrGreaterThan

func (fil UnaryFilter) OrGreaterThan(field labels.Label, value string) CompoundFilter

func (UnaryFilter) OrGreaterThanOrEqualTo

func (fil UnaryFilter) OrGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) OrNotEqualTo

func (fil UnaryFilter) OrNotEqualTo(field labels.Label, value string) CompoundFilter

func (UnaryFilter) OrNotGreaterThan

func (fil UnaryFilter) OrNotGreaterThan(field labels.Label, value string) CompoundFilter

func (UnaryFilter) OrNotGreaterThanOrEqualTo

func (fil UnaryFilter) OrNotGreaterThanOrEqualTo(field labels.Label, value string) CompoundFilter

Jump to

Keyboard shortcuts

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