Documentation
¶
Overview ¶
Package filter contains types and methods for parsing and applying filters to resources being queried by a ListXXX request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter represents a filter that can be applied when querying an arbitrary API resource.
func NewWithKeyMap ¶
func NewWithKeyMap(filterProto *api.Filter, keyMap map[string]string, modelName string) (*Filter, error)
NewWithKeyMap is like New, but takes an additional map and model name for mapping key names in the protocol buffer to an appropriate name for use when querying the model. For example, if the API name of a field is "name", the model name is "pipelines", and the equivalent column name is "Name", then filterProto with predicates against key "name" will be parsed as if the key value was "pipelines.Name".
func (*Filter) AddToSelect ¶
func (f *Filter) AddToSelect(sb squirrel.SelectBuilder) squirrel.SelectBuilder
AddToSelect builds a WHERE clause from the Filter f, adds it to the supplied SelectBuilder object and returns it for use in SQL queries.
func (*Filter) MarshalJSON ¶
MarshalJSON implements JSON Marshaler for Filter.
func (*Filter) UnmarshalJSON ¶
UnmarshalJSON implements JSON Unmarshaler for Filter.