query

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package query is a generated protocol buffer package.

It is generated from these files:

github.com/infobloxopen/atlas-app-toolkit/query/collection_operators.proto

It has these top-level messages:

SortCriteria
Sorting
FieldSelection
Field
Filtering
LogicalOperator
StringCondition
NumberCondition
NullCondition
Pagination
PageInfo

Index

Constants

View Source
const (
	// Default pagination limit
	DefaultLimit = 1000
)

Variables

View Source
var LogicalOperator_Type_name = map[int32]string{
	0: "AND",
	1: "OR",
}
View Source
var LogicalOperator_Type_value = map[string]int32{
	"AND": 0,
	"OR":  1,
}
View Source
var NumberCondition_Type_name = map[int32]string{
	0: "EQ",
	1: "GT",
	2: "GE",
	3: "LT",
	4: "LE",
}
View Source
var NumberCondition_Type_value = map[string]int32{
	"EQ": 0,
	"GT": 1,
	"GE": 2,
	"LT": 3,
	"LE": 4,
}
View Source
var SortCriteria_Order_name = map[int32]string{
	0: "ASC",
	1: "DESC",
}
View Source
var SortCriteria_Order_value = map[string]int32{
	"ASC":  0,
	"DESC": 1,
}
View Source
var StringCondition_Type_name = map[int32]string{
	0: "EQ",
	1: "MATCH",
}
View Source
var StringCondition_Type_value = map[string]int32{
	"EQ":    0,
	"MATCH": 1,
}

Functions

func Filter

func Filter(obj interface{}, filter string) (bool, error)

Filter is a shortcut to parse a filter string using default FilteringParser implementation and call Filter on the returned filtering expression.

Types

type AndToken

type AndToken struct {
	TokenBase
}

AndToken represents logical and.

func (AndToken) String

func (t AndToken) String() string

type EOFToken

type EOFToken struct {
	TokenBase
}

EOFToken represents end of an expression.

func (EOFToken) String

func (t EOFToken) String() string

type EqToken

type EqToken struct {
	TokenBase
}

EqToken represents equals operator.

func (EqToken) String

func (t EqToken) String() string

type Field

type Field struct {
	Name string            `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Subs map[string]*Field `` /* 128-byte string literal not displayed */
}

Field represents a single field for an object. It contains fields name and also may contain a group of sub-fields for cases when a fields represents some structure.

func (*Field) Descriptor

func (*Field) Descriptor() ([]byte, []int)

func (*Field) GetName

func (m *Field) GetName() string

func (*Field) GetSubs

func (m *Field) GetSubs() map[string]*Field

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) Reset

func (m *Field) Reset()

func (*Field) String

func (m *Field) String() string

type FieldSelection

type FieldSelection struct {
	Fields map[string]*Field `` /* 132-byte string literal not displayed */
}

FieldSelection represents a group of fields for some object. Main use case for if is to store information about object fields that need to be ratained prior to sending object as a response

func ParseFieldSelection

func ParseFieldSelection(input string, delimiter ...string) *FieldSelection

ParseFieldSelection transforms a string with comma-separated fields that comes from client to FieldSelection struct. For complex fields dot is used as a delimeter by default, but it is also possible to specify a different delimiter.

func (*FieldSelection) Add

func (f *FieldSelection) Add(field string, delimiter ...string)

Add allows to add new fields to FieldSelection

func (*FieldSelection) Delete

func (f *FieldSelection) Delete(field string, delimiter ...string) bool

Delete allows to remove fields from FieldSelection

func (*FieldSelection) Descriptor

func (*FieldSelection) Descriptor() ([]byte, []int)

func (*FieldSelection) Get

func (f *FieldSelection) Get(field string, delimiter ...string) *Field

Get allows to get specified field from FieldSelection

func (*FieldSelection) GetFields

func (m *FieldSelection) GetFields() map[string]*Field

func (*FieldSelection) GoString

func (f *FieldSelection) GoString() string

GoString converts FieldSelection to a string representation It implements fmt.GoStringer interface and returns dot-notated fields separated by commas

func (*FieldSelection) ProtoMessage

func (*FieldSelection) ProtoMessage()

func (*FieldSelection) Reset

func (m *FieldSelection) Reset()

func (*FieldSelection) String

func (m *FieldSelection) String() string

type FieldSelectionMap

type FieldSelectionMap map[string]*Field

FieldSelectionMap is a convenience type that represents map[string]*Field used in FieldSelection and Field structs

type FieldToken

type FieldToken struct {
	TokenBase
	Value string
}

FieldToken represents a reference to a value of a resource. Value is a value of the reference.

func (FieldToken) String

func (t FieldToken) String() string

type Filtering

type Filtering struct {
	// Types that are valid to be assigned to Root:
	//	*Filtering_Operator
	//	*Filtering_StringCondition
	//	*Filtering_NumberCondition
	//	*Filtering_NullCondition
	Root isFiltering_Root `protobuf_oneof:"root"`
}

Filtering represents filtering expression. root could be either LogicalOperator or one of the supported conditions.

func ParseFiltering

func ParseFiltering(text string) (*Filtering, error)

ParseFiltering is a shortcut to parse a filtering expression using default FilteringParser implementation

func (*Filtering) Descriptor

func (*Filtering) Descriptor() ([]byte, []int)

func (*Filtering) Filter

func (m *Filtering) Filter(obj interface{}) (bool, error)

Filter evaluates underlying filtering expression against obj. If obj implements Matcher, call it's custom implementation.

func (*Filtering) GetNullCondition

func (m *Filtering) GetNullCondition() *NullCondition

func (*Filtering) GetNumberCondition

func (m *Filtering) GetNumberCondition() *NumberCondition

func (*Filtering) GetOperator

func (m *Filtering) GetOperator() *LogicalOperator

func (*Filtering) GetRoot

func (m *Filtering) GetRoot() isFiltering_Root

func (*Filtering) GetStringCondition

func (m *Filtering) GetStringCondition() *StringCondition

func (*Filtering) ProtoMessage

func (*Filtering) ProtoMessage()

func (*Filtering) Reset

func (m *Filtering) Reset()

func (*Filtering) SetRoot

func (m *Filtering) SetRoot(r interface{}) error

SetRoot automatically wraps r into appropriate oneof structure and sets it to Root.

func (*Filtering) String

func (m *Filtering) String() string

func (*Filtering) XXX_OneofFuncs

func (*Filtering) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type FilteringExpression

type FilteringExpression interface {
	Filter(interface{}) (bool, error)
}

FilteringExpression is the interface implemented by types that represent nodes in a filtering expression AST.

type FilteringLexer

type FilteringLexer interface {
	NextToken() (Token, error)
}

FilteringLexer is impemented by lexical analyzers that are used by filtering expression parsers.

func NewFilteringLexer

func NewFilteringLexer(text string) FilteringLexer

NewFilteringLexer returns a default FilteringLexer implementation. text is a filtering expression to analyze.

type FilteringParser

type FilteringParser interface {
	Parse(string) (*Filtering, error)
}

FilteringParser is implemented by parsers of a filtering expression that conforms to REST API Syntax Specification.

func NewFilteringParser

func NewFilteringParser() FilteringParser

NewFilteringParser returns a default FilteringParser implementation.

type Filtering_NullCondition

type Filtering_NullCondition struct {
	NullCondition *NullCondition `protobuf:"bytes,4,opt,name=null_condition,json=nullCondition,oneof"`
}

func (*Filtering_NullCondition) Filter

func (m *Filtering_NullCondition) Filter(obj interface{}) (bool, error)

type Filtering_NumberCondition

type Filtering_NumberCondition struct {
	NumberCondition *NumberCondition `protobuf:"bytes,3,opt,name=number_condition,json=numberCondition,oneof"`
}

func (*Filtering_NumberCondition) Filter

func (m *Filtering_NumberCondition) Filter(obj interface{}) (bool, error)

type Filtering_Operator

type Filtering_Operator struct {
	Operator *LogicalOperator `protobuf:"bytes,1,opt,name=operator,oneof"`
}

func (*Filtering_Operator) Filter

func (m *Filtering_Operator) Filter(obj interface{}) (bool, error)

type Filtering_StringCondition

type Filtering_StringCondition struct {
	StringCondition *StringCondition `protobuf:"bytes,2,opt,name=string_condition,json=stringCondition,oneof"`
}

func (*Filtering_StringCondition) Filter

func (m *Filtering_StringCondition) Filter(obj interface{}) (bool, error)

type GeToken

type GeToken struct {
	TokenBase
}

GeToken represents greater than or equals operator.

func (GeToken) String

func (t GeToken) String() string

type GtToken

type GtToken struct {
	TokenBase
}

GtToken represents greater than operator.

func (GtToken) String

func (t GtToken) String() string

type LeToken

type LeToken struct {
	TokenBase
}

LeToken represents less than or equals operator.

func (LeToken) String

func (t LeToken) String() string

type LogicalOperator

type LogicalOperator struct {
	// Types that are valid to be assigned to Left:
	//	*LogicalOperator_LeftOperator
	//	*LogicalOperator_LeftStringCondition
	//	*LogicalOperator_LeftNumberCondition
	//	*LogicalOperator_LeftNullCondition
	Left isLogicalOperator_Left `protobuf_oneof:"left"`
	// Types that are valid to be assigned to Right:
	//	*LogicalOperator_RightOperator
	//	*LogicalOperator_RightStringCondition
	//	*LogicalOperator_RightNumberCondition
	//	*LogicalOperator_RightNullCondition
	Right      isLogicalOperator_Right `protobuf_oneof:"right"`
	Type       LogicalOperator_Type    `protobuf:"varint,9,opt,name=type,enum=infoblox.api.LogicalOperator_Type" json:"type,omitempty"`
	IsNegative bool                    `protobuf:"varint,10,opt,name=is_negative,json=isNegative" json:"is_negative,omitempty"`
}

LogicalOperator represents binary logical operator, either AND or OR depending on type. left and right are respectively left and right operands of the operator, could be either LogicalOperator or one of the supported conditions. is_negative is set to true if the operator is negated.

func (*LogicalOperator) Descriptor

func (*LogicalOperator) Descriptor() ([]byte, []int)

func (*LogicalOperator) Filter

func (lop *LogicalOperator) Filter(obj interface{}) (bool, error)

Filter evaluates filtering expression against obj.

func (*LogicalOperator) GetIsNegative

func (m *LogicalOperator) GetIsNegative() bool

func (*LogicalOperator) GetLeft

func (m *LogicalOperator) GetLeft() isLogicalOperator_Left

func (*LogicalOperator) GetLeftNullCondition

func (m *LogicalOperator) GetLeftNullCondition() *NullCondition

func (*LogicalOperator) GetLeftNumberCondition

func (m *LogicalOperator) GetLeftNumberCondition() *NumberCondition

func (*LogicalOperator) GetLeftOperator

func (m *LogicalOperator) GetLeftOperator() *LogicalOperator

func (*LogicalOperator) GetLeftStringCondition

func (m *LogicalOperator) GetLeftStringCondition() *StringCondition

func (*LogicalOperator) GetRight

func (m *LogicalOperator) GetRight() isLogicalOperator_Right

func (*LogicalOperator) GetRightNullCondition

func (m *LogicalOperator) GetRightNullCondition() *NullCondition

func (*LogicalOperator) GetRightNumberCondition

func (m *LogicalOperator) GetRightNumberCondition() *NumberCondition

func (*LogicalOperator) GetRightOperator

func (m *LogicalOperator) GetRightOperator() *LogicalOperator

func (*LogicalOperator) GetRightStringCondition

func (m *LogicalOperator) GetRightStringCondition() *StringCondition

func (*LogicalOperator) GetType

func (*LogicalOperator) ProtoMessage

func (*LogicalOperator) ProtoMessage()

func (*LogicalOperator) Reset

func (m *LogicalOperator) Reset()

func (*LogicalOperator) SetLeft

func (m *LogicalOperator) SetLeft(l interface{}) error

SetLeft automatically wraps l into appropriate oneof structure and sets it to Root.

func (*LogicalOperator) SetRight

func (m *LogicalOperator) SetRight(r interface{}) error

SetRight automatically wraps r into appropriate oneof structure and sets it to Root.

func (*LogicalOperator) String

func (m *LogicalOperator) String() string

func (*LogicalOperator) XXX_OneofFuncs

func (*LogicalOperator) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type LogicalOperator_LeftNullCondition

type LogicalOperator_LeftNullCondition struct {
	LeftNullCondition *NullCondition `protobuf:"bytes,4,opt,name=left_null_condition,json=leftNullCondition,oneof"`
}

func (*LogicalOperator_LeftNullCondition) Filter

func (m *LogicalOperator_LeftNullCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_LeftNumberCondition

type LogicalOperator_LeftNumberCondition struct {
	LeftNumberCondition *NumberCondition `protobuf:"bytes,3,opt,name=left_number_condition,json=leftNumberCondition,oneof"`
}

func (*LogicalOperator_LeftNumberCondition) Filter

func (m *LogicalOperator_LeftNumberCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_LeftOperator

type LogicalOperator_LeftOperator struct {
	LeftOperator *LogicalOperator `protobuf:"bytes,1,opt,name=left_operator,json=leftOperator,oneof"`
}

func (*LogicalOperator_LeftOperator) Filter

func (m *LogicalOperator_LeftOperator) Filter(obj interface{}) (bool, error)

type LogicalOperator_LeftStringCondition

type LogicalOperator_LeftStringCondition struct {
	LeftStringCondition *StringCondition `protobuf:"bytes,2,opt,name=left_string_condition,json=leftStringCondition,oneof"`
}

func (*LogicalOperator_LeftStringCondition) Filter

func (m *LogicalOperator_LeftStringCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_RightNullCondition

type LogicalOperator_RightNullCondition struct {
	RightNullCondition *NullCondition `protobuf:"bytes,8,opt,name=right_null_condition,json=rightNullCondition,oneof"`
}

func (*LogicalOperator_RightNullCondition) Filter

func (m *LogicalOperator_RightNullCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_RightNumberCondition

type LogicalOperator_RightNumberCondition struct {
	RightNumberCondition *NumberCondition `protobuf:"bytes,7,opt,name=right_number_condition,json=rightNumberCondition,oneof"`
}

func (*LogicalOperator_RightNumberCondition) Filter

func (m *LogicalOperator_RightNumberCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_RightOperator

type LogicalOperator_RightOperator struct {
	RightOperator *LogicalOperator `protobuf:"bytes,5,opt,name=right_operator,json=rightOperator,oneof"`
}

func (*LogicalOperator_RightOperator) Filter

func (m *LogicalOperator_RightOperator) Filter(obj interface{}) (bool, error)

type LogicalOperator_RightStringCondition

type LogicalOperator_RightStringCondition struct {
	RightStringCondition *StringCondition `protobuf:"bytes,6,opt,name=right_string_condition,json=rightStringCondition,oneof"`
}

func (*LogicalOperator_RightStringCondition) Filter

func (m *LogicalOperator_RightStringCondition) Filter(obj interface{}) (bool, error)

type LogicalOperator_Type

type LogicalOperator_Type int32
const (
	LogicalOperator_AND LogicalOperator_Type = 0
	LogicalOperator_OR  LogicalOperator_Type = 1
)

func (LogicalOperator_Type) EnumDescriptor

func (LogicalOperator_Type) EnumDescriptor() ([]byte, []int)

func (LogicalOperator_Type) String

func (x LogicalOperator_Type) String() string

type LparenToken

type LparenToken struct {
	TokenBase
}

LparenToken represents left parenthesis.

func (LparenToken) String

func (t LparenToken) String() string

type LtToken

type LtToken struct {
	TokenBase
}

LtToken represents less than operator.

func (LtToken) String

func (t LtToken) String() string

type MatchToken

type MatchToken struct {
	TokenBase
}

MatchToken represents regular expression match.

func (MatchToken) String

func (t MatchToken) String() string

type Matcher

type Matcher interface {
	Match(*Filtering) (bool, error)
}

Matcher is implemented by structs that require custom filtering logic.

type NeToken

type NeToken struct {
	TokenBase
}

NeToken represents not equals operator.

func (NeToken) String

func (t NeToken) String() string

type NmatchToken

type NmatchToken struct {
	TokenBase
}

NmatchToken represents negation of regular expression match.

func (NmatchToken) String

func (t NmatchToken) String() string

type NotToken

type NotToken struct {
	TokenBase
}

NotToken represents logical not.

func (NotToken) String

func (t NotToken) String() string

type NullCondition

type NullCondition struct {
	FieldPath  []string `protobuf:"bytes,1,rep,name=field_path,json=fieldPath" json:"field_path,omitempty"`
	IsNegative bool     `protobuf:"varint,2,opt,name=is_negative,json=isNegative" json:"is_negative,omitempty"`
}

NullCondition represents a condition with a null literal, e.g. field == null. field_path is a reference to a value of a resource. is_negative is set to true if the condition is negated.

func (*NullCondition) Descriptor

func (*NullCondition) Descriptor() ([]byte, []int)

func (*NullCondition) Filter

func (c *NullCondition) Filter(obj interface{}) (bool, error)

Filter evaluates null condition against obj. If obj is a proto message, then 'protobuf' tag is used to map FieldPath to obj's struct fields, otherwise 'json' tag is used.

func (*NullCondition) GetFieldPath

func (m *NullCondition) GetFieldPath() []string

func (*NullCondition) GetIsNegative

func (m *NullCondition) GetIsNegative() bool

func (*NullCondition) ProtoMessage

func (*NullCondition) ProtoMessage()

func (*NullCondition) Reset

func (m *NullCondition) Reset()

func (*NullCondition) String

func (m *NullCondition) String() string

type NullToken

type NullToken struct {
	TokenBase
}

NullToken represents null literal.

func (NullToken) String

func (t NullToken) String() string

type NumberCondition

type NumberCondition struct {
	FieldPath  []string             `protobuf:"bytes,1,rep,name=field_path,json=fieldPath" json:"field_path,omitempty"`
	Value      float64              `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"`
	Type       NumberCondition_Type `protobuf:"varint,3,opt,name=type,enum=infoblox.api.NumberCondition_Type" json:"type,omitempty"`
	IsNegative bool                 `protobuf:"varint,4,opt,name=is_negative,json=isNegative" json:"is_negative,omitempty"`
}

NumberCondition represents a condition with a number literal, e.g. field > 3. field_path is a reference to a value of a resource. value is the number literal. type is a type of the condition. is_negative is set to true if the condition is negated.

func (*NumberCondition) Descriptor

func (*NumberCondition) Descriptor() ([]byte, []int)

func (*NumberCondition) Filter

func (c *NumberCondition) Filter(obj interface{}) (bool, error)

Filter evaluates number condition against obj. If obj is a proto message, then 'protobuf' tag is used to map FieldPath to obj's struct fields, otherwise 'json' tag is used.

func (*NumberCondition) GetFieldPath

func (m *NumberCondition) GetFieldPath() []string

func (*NumberCondition) GetIsNegative

func (m *NumberCondition) GetIsNegative() bool

func (*NumberCondition) GetType

func (*NumberCondition) GetValue

func (m *NumberCondition) GetValue() float64

func (*NumberCondition) ProtoMessage

func (*NumberCondition) ProtoMessage()

func (*NumberCondition) Reset

func (m *NumberCondition) Reset()

func (*NumberCondition) String

func (m *NumberCondition) String() string

type NumberCondition_Type

type NumberCondition_Type int32
const (
	NumberCondition_EQ NumberCondition_Type = 0
	NumberCondition_GT NumberCondition_Type = 1
	NumberCondition_GE NumberCondition_Type = 2
	NumberCondition_LT NumberCondition_Type = 3
	NumberCondition_LE NumberCondition_Type = 4
)

func (NumberCondition_Type) EnumDescriptor

func (NumberCondition_Type) EnumDescriptor() ([]byte, []int)

func (NumberCondition_Type) String

func (x NumberCondition_Type) String() string

type NumberToken

type NumberToken struct {
	TokenBase
	Value float64
}

NumberToken represents a number literal. Value is a value of the literal.

func (NumberToken) String

func (t NumberToken) String() string

type OrToken

type OrToken struct {
	TokenBase
}

OrToken represents logical or.

func (OrToken) String

func (t OrToken) String() string

type PageInfo

type PageInfo struct {
	// The service response should contain a string to indicate
	// the next page of resources.
	// A null value indicates no more pages.
	PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken" json:"page_token,omitempty"`
	// The service may optionally include the total number of resources being paged.
	Size int32 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"`
	// The service may optionally include the offset of the next page of resources.
	// A null value indicates no more pages.
	Offset int32 `protobuf:"varint,3,opt,name=offset" json:"offset,omitempty"`
}

PageInfo represents both server-driven and client-driven pagination response. Server-driven pagination is a model in which the server returns some amount of data along with an token indicating there is more data and where subsequent queries can get the next page of data. Client-driven pagination is a model in which rows are addressable by offset and page size (limit).

func (*PageInfo) Descriptor

func (*PageInfo) Descriptor() ([]byte, []int)

func (*PageInfo) GetOffset

func (m *PageInfo) GetOffset() int32

func (*PageInfo) GetPageToken

func (m *PageInfo) GetPageToken() string

func (*PageInfo) GetSize

func (m *PageInfo) GetSize() int32

func (*PageInfo) NoMore

func (p *PageInfo) NoMore() bool

NoMore reports whether page info indicates no more pages are available

func (*PageInfo) ProtoMessage

func (*PageInfo) ProtoMessage()

func (*PageInfo) Reset

func (m *PageInfo) Reset()

func (*PageInfo) SetLastOffset

func (p *PageInfo) SetLastOffset()

SetLastOffset sets page info to indicate no more pages are available

func (*PageInfo) SetLastToken

func (p *PageInfo) SetLastToken()

SetLastToken sets page info to indicate no more pages are available

func (*PageInfo) String

func (m *PageInfo) String() string

type Pagination

type Pagination struct {
	// The service-defined string used to identify a page of resources.
	// A null value indicates the first page.
	PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken" json:"page_token,omitempty"`
	// The integer index of the offset into a collection of resources.
	// If omitted or null the value is assumed to be "0".
	Offset int32 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
	// The integer number of resources to be returned in the response.
	// The service may impose maximum value.
	// If omitted the service may impose a default value.
	Limit int32 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"`
}

Pagination represents both server-driven and client-driven pagination request. Server-driven pagination is a model in which the server returns some amount of data along with an token indicating there is more data and where subsequent queries can get the next page of data. Client-driven pagination is a model in which rows are addressable by offset and page size (limit).

func ParsePagination

func ParsePagination(limit, offset, ptoken string) (*Pagination, error)

Pagination parses string representation of pagination limit, offset. Returns error if limit or offset has invalid syntax or out of range.

func (*Pagination) DefaultLimit

func (p *Pagination) DefaultLimit(dl ...int32) int32

DefaultLimit returns DefaultLimit if limit was not specified otherwise returns either requested or specified one.

func (*Pagination) Descriptor

func (*Pagination) Descriptor() ([]byte, []int)

func (*Pagination) FirstPage

func (p *Pagination) FirstPage() bool

FirstPage returns true if requested first page

func (*Pagination) GetLimit

func (m *Pagination) GetLimit() int32

func (*Pagination) GetOffset

func (m *Pagination) GetOffset() int32

func (*Pagination) GetPageToken

func (m *Pagination) GetPageToken() string

func (*Pagination) ProtoMessage

func (*Pagination) ProtoMessage()

func (*Pagination) Reset

func (m *Pagination) Reset()

func (*Pagination) String

func (m *Pagination) String() string

type RparenToken

type RparenToken struct {
	TokenBase
}

RparenToken represents right parenthesis.

func (RparenToken) String

func (t RparenToken) String() string

type SortCriteria

type SortCriteria struct {
	// Tag is a JSON tag.
	Tag   string             `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"`
	Order SortCriteria_Order `protobuf:"varint,2,opt,name=order,enum=infoblox.api.SortCriteria_Order" json:"order,omitempty"`
}

SortCriteria represents sort criteria

func (*SortCriteria) Descriptor

func (*SortCriteria) Descriptor() ([]byte, []int)

func (*SortCriteria) GetOrder

func (m *SortCriteria) GetOrder() SortCriteria_Order

func (*SortCriteria) GetTag

func (m *SortCriteria) GetTag() string

func (SortCriteria) GoString

func (c SortCriteria) GoString() string

GoString implements fmt.GoStringer interface return string representation of a sort criteria in next form: "<tag_name> (ASC|DESC)".

func (SortCriteria) IsAsc

func (c SortCriteria) IsAsc() bool

IsAsc returns true if sort criteria has ascending sort order, otherwise false.

func (SortCriteria) IsDesc

func (c SortCriteria) IsDesc() bool

IsDesc returns true if sort criteria has descending sort order, otherwise false.

func (*SortCriteria) ProtoMessage

func (*SortCriteria) ProtoMessage()

func (*SortCriteria) Reset

func (m *SortCriteria) Reset()

func (*SortCriteria) String

func (m *SortCriteria) String() string

type SortCriteria_Order

type SortCriteria_Order int32

Order is a sort order.

const (
	// ascending sort order
	SortCriteria_ASC SortCriteria_Order = 0
	// descending sort order
	SortCriteria_DESC SortCriteria_Order = 1
)

func (SortCriteria_Order) EnumDescriptor

func (SortCriteria_Order) EnumDescriptor() ([]byte, []int)

func (SortCriteria_Order) String

func (x SortCriteria_Order) String() string

type Sorting

type Sorting struct {
	Criterias []*SortCriteria `protobuf:"bytes,1,rep,name=criterias" json:"criterias,omitempty"`
}

Sorting represents list of sort criterias.

func ParseSorting

func ParseSorting(s string) (*Sorting, error)

ParseSorting parses raw string that represent sort criteria into a Sorting data structure. Provided string is supposed to be in accordance with the sorting collection operator from REST API Syntax. See: https://github.com/infobloxopen/atlas-app-toolkit#sorting

func (*Sorting) Descriptor

func (*Sorting) Descriptor() ([]byte, []int)

func (*Sorting) GetCriterias

func (m *Sorting) GetCriterias() []*SortCriteria

func (Sorting) GoString

func (s Sorting) GoString() string

GoString implements fmt.GoStringer interface Returns string representation of sorting in next form: "<name> (ASC|DESC) [, <tag_name> (ASC|DESC)]"

func (*Sorting) ProtoMessage

func (*Sorting) ProtoMessage()

func (*Sorting) Reset

func (m *Sorting) Reset()

func (*Sorting) String

func (m *Sorting) String() string

type StringCondition

type StringCondition struct {
	FieldPath  []string             `protobuf:"bytes,1,rep,name=field_path,json=fieldPath" json:"field_path,omitempty"`
	Value      string               `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	Type       StringCondition_Type `protobuf:"varint,3,opt,name=type,enum=infoblox.api.StringCondition_Type" json:"type,omitempty"`
	IsNegative bool                 `protobuf:"varint,4,opt,name=is_negative,json=isNegative" json:"is_negative,omitempty"`
}

StringCondition represents a condition with a string literal, e.g. field == 'string'. field_path is a reference to a value of a resource. value is the string literal. type is a type of the condition. is_negative is set to true if the condition is negated.

func (*StringCondition) Descriptor

func (*StringCondition) Descriptor() ([]byte, []int)

func (*StringCondition) Filter

func (c *StringCondition) Filter(obj interface{}) (bool, error)

Filter evaluates string condition against obj. If obj is a proto message, then 'protobuf' tag is used to map FieldPath to obj's struct fields, otherwise 'json' tag is used.

func (*StringCondition) GetFieldPath

func (m *StringCondition) GetFieldPath() []string

func (*StringCondition) GetIsNegative

func (m *StringCondition) GetIsNegative() bool

func (*StringCondition) GetType

func (*StringCondition) GetValue

func (m *StringCondition) GetValue() string

func (*StringCondition) ProtoMessage

func (*StringCondition) ProtoMessage()

func (*StringCondition) Reset

func (m *StringCondition) Reset()

func (*StringCondition) String

func (m *StringCondition) String() string

type StringCondition_Type

type StringCondition_Type int32
const (
	StringCondition_EQ    StringCondition_Type = 0
	StringCondition_MATCH StringCondition_Type = 1
)

func (StringCondition_Type) EnumDescriptor

func (StringCondition_Type) EnumDescriptor() ([]byte, []int)

func (StringCondition_Type) String

func (x StringCondition_Type) String() string

type StringToken

type StringToken struct {
	TokenBase
	Value string
}

StringToken represents a string literal. Value is a value of the literal.

func (StringToken) String

func (t StringToken) String() string

type Token

type Token interface {
	Token()
}

Token is impelemented by all supported tokens in a filtering expression.

type TokenBase

type TokenBase struct{}

TokenBase is used as a base type for all types which are tokens.

func (TokenBase) Token

func (t TokenBase) Token()

Token distinguishes tokens from other types.

type TypeMismatchError

type TypeMismatchError struct {
	ReqType   string
	FieldPath []string
}

TypeMismatchError representes a type that is required for a value under FieldPath.

func (*TypeMismatchError) Error

func (e *TypeMismatchError) Error() string

type UnexpectedSymbolError

type UnexpectedSymbolError struct {
	S   rune
	Pos int
}

UnexpectedSymbolError describes symbol S in position Pos that was not appropriate according to REST API Syntax Specification.

func (*UnexpectedSymbolError) Error

func (e *UnexpectedSymbolError) Error() string

type UnexpectedTokenError

type UnexpectedTokenError struct {
	T Token
}

UnexpectedTokenError describes a token that was not appropriate according to REST API Syntax Specification.

func (*UnexpectedTokenError) Error

func (e *UnexpectedTokenError) Error() string

type UnsupportedOperatorError

type UnsupportedOperatorError struct {
	Type string
	Op   string
}

UnsupportedOperatorError represents an operator that is not supported by a particular field type.

func (*UnsupportedOperatorError) Error

func (e *UnsupportedOperatorError) Error() string

Jump to

Keyboard shortcuts

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