filtering

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Must    *Must    `json:"must,omitempty"`
	MustNot *MustNot `json:"must_not,omitempty"`
	Should  *Should  `json:"should,omitempty"`
	Term    *Term    `json:"term,omitempty"`
}

Bool holds a general query that carries any number of Must, MustNot, and Should operations

type Filterer

type Filterer interface {
	ParseExpression(filter string) (*Query, error)
}

func NewFilterer

func NewFilterer() Filterer

type HasParent added in v0.8.1

type HasParent struct {
	ParentType string `json:"parent_type"`
	Query      *Query `json:"query"`
}

HasParent is used to query for resources that use a join field and have a parent resource

type Must

type Must []interface{}

Must holds a must operator which each equates to an AND operation

type MustNot

type MustNot []interface{}

MustNot holds a must_not operator which each equates to a != operation

type Nested added in v0.5.0

type Nested struct {
	Path  string `json:"path"`
	Query *Query `json:"query,omitempty"`
}

type Query

type Query struct {
	Bool        *Bool        `json:"bool,omitempty"`
	Term        *Term        `json:"term,omitempty"`
	Prefix      *Term        `json:"prefix,omitempty"`
	QueryString *QueryString `json:"query_string,omitempty"`
	Nested      *Nested      `json:"nested,omitempty"`
	Range       *Range       `json:"range,omitempty"`
	HasParent   *HasParent   `json:"has_parent,omitempty"`
}

Query holds a parent query that carries the entire search query

type QueryString

type QueryString struct {
	DefaultField string `json:"default_field"`
	Query        string `json:"query"`
}

type Range added in v0.6.0

type Range map[string]*RangeOperator

Holds an operator that evaluates a range for comparisons

type RangeOperator added in v0.6.0

type RangeOperator struct {
	Greater       string `json:"gt,omitempty"`
	GreaterEquals string `json:"gte,omitempty"`
	Less          string `json:"lt,omitempty"`
	LessEquals    string `json:"lte,omitempty"`
}

type Should

type Should []interface{}

Should holds a should operator which equates to an OR operation

type Term

type Term map[string]string

Term holds a comparison for equating two strings

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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