Documentation
¶
Index ¶
- Variables
- type Condition
- func (*Condition) Descriptor() ([]byte, []int)deprecated
- func (x *Condition) GetField() string
- func (x *Condition) GetOp() Operator
- func (x *Condition) GetValues() []string
- func (*Condition) ProtoMessage()
- func (x *Condition) ProtoReflect() protoreflect.Message
- func (x *Condition) Reset()
- func (x *Condition) String() string
- type Descriptor
- func (*Descriptor) Descriptor() ([]byte, []int)deprecated
- func (x *Descriptor) GetDefaultSort() []*Sort
- func (x *Descriptor) GetFields() []*FieldDescriptor
- func (x *Descriptor) GetResource() string
- func (*Descriptor) ProtoMessage()
- func (x *Descriptor) ProtoReflect() protoreflect.Message
- func (x *Descriptor) Reset()
- func (x *Descriptor) String() string
- type FieldDescriptor
- func (*FieldDescriptor) Descriptor() ([]byte, []int)deprecated
- func (x *FieldDescriptor) GetName() string
- func (x *FieldDescriptor) GetOperators() []Operator
- func (x *FieldDescriptor) GetType() FieldType
- func (*FieldDescriptor) ProtoMessage()
- func (x *FieldDescriptor) ProtoReflect() protoreflect.Message
- func (x *FieldDescriptor) Reset()
- func (x *FieldDescriptor) String() string
- type FieldType
- type FilterOp
- type Filters
- type Operator
- type Page
- type Payload
- func (*Payload) Descriptor() ([]byte, []int)deprecated
- func (x *Payload) GetFilters() *Filters
- func (x *Payload) GetObligations() map[string]string
- func (x *Payload) GetPage() *Page
- func (x *Payload) GetSort() []*Sort
- func (*Payload) ProtoMessage()
- func (x *Payload) ProtoReflect() protoreflect.Message
- func (x *Payload) Reset()
- func (x *Payload) String() string
- type Sort
- type SortDir
Constants ¶
This section is empty.
Variables ¶
var ( FieldType_name = map[int32]string{ 0: "FIELD_TYPE_UNSPECIFIED", 1: "FIELD_TYPE_STRING", 2: "FIELD_TYPE_NUMBER", 3: "FIELD_TYPE_BOOLEAN", 4: "FIELD_TYPE_DATETIME", } FieldType_value = map[string]int32{ "FIELD_TYPE_UNSPECIFIED": 0, "FIELD_TYPE_STRING": 1, "FIELD_TYPE_NUMBER": 2, "FIELD_TYPE_BOOLEAN": 3, "FIELD_TYPE_DATETIME": 4, } )
Enum value maps for FieldType.
var ( Operator_name = map[int32]string{ 0: "OPERATOR_UNSPECIFIED", 1: "OPERATOR_EQ", 2: "OPERATOR_NE", 4: "OPERATOR_IN", 5: "OPERATOR_GT", 6: "OPERATOR_GTE", 7: "OPERATOR_LT", 8: "OPERATOR_LTE", 9: "OPERATOR_EXISTS", } Operator_value = map[string]int32{ "OPERATOR_UNSPECIFIED": 0, "OPERATOR_EQ": 1, "OPERATOR_NE": 2, "OPERATOR_IN": 4, "OPERATOR_GT": 5, "OPERATOR_GTE": 6, "OPERATOR_LT": 7, "OPERATOR_LTE": 8, "OPERATOR_EXISTS": 9, } )
Enum value maps for Operator.
var ( SortDir_name = map[int32]string{ 0: "SORT_DIR_UNSPECIFIED", 1: "SORT_DIR_ASC", 2: "SORT_DIR_DESC", } SortDir_value = map[string]int32{ "SORT_DIR_UNSPECIFIED": 0, "SORT_DIR_ASC": 1, "SORT_DIR_DESC": 2, } )
Enum value maps for SortDir.
var ( FilterOp_name = map[int32]string{ 0: "FILTER_OP_UNSPECIFIED", 1: "FILTER_OP_AND", 2: "FILTER_OP_OR", } FilterOp_value = map[string]int32{ "FILTER_OP_UNSPECIFIED": 0, "FILTER_OP_AND": 1, "FILTER_OP_OR": 2, } )
Enum value maps for FilterOp.
var File_query_v1_query_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
// field must match a FieldDescriptor.name from the resource's Descriptor.
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Op Operator `protobuf:"varint,2,opt,name=op,proto3,enum=query.v1.Operator" json:"op,omitempty"`
// values holds the operand(s) for op. Single-value operators (eq, ne, gt,
// gte, lt, lte) expect exactly one entry; "in" expects one or more;
// "exists" expects zero or one ("true"/"false", default "true"). For eq/ne
// on a FIELD_TYPE_STRING field, the value may use glob wildcards ("*",
// "?"); see Operator.
Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
// contains filtered or unexported fields
}
Condition is a single filter condition on one field.
func (*Condition) Descriptor
deprecated
func (*Condition) ProtoMessage ¶
func (*Condition) ProtoMessage()
func (*Condition) ProtoReflect ¶
func (x *Condition) ProtoReflect() protoreflect.Message
type Descriptor ¶
type Descriptor struct {
// resource is the resource identifier, e.g. "users".
Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
Fields []*FieldDescriptor `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
// default_sort applies when a client's Payload specifies no sort.
DefaultSort []*Sort `protobuf:"bytes,3,rep,name=default_sort,json=defaultSort,proto3" json:"default_sort,omitempty"`
// contains filtered or unexported fields
}
Descriptor describes which fields of a resource are queryable and sortable. Each resource-owning service declares and serves its own Descriptor (e.g. via a <Resource>QuerySchema RPC); it is also the basis against which that service validates incoming Payloads.
func (*Descriptor) Descriptor
deprecated
func (*Descriptor) Descriptor() ([]byte, []int)
Deprecated: Use Descriptor.ProtoReflect.Descriptor instead.
func (*Descriptor) GetDefaultSort ¶
func (x *Descriptor) GetDefaultSort() []*Sort
func (*Descriptor) GetFields ¶
func (x *Descriptor) GetFields() []*FieldDescriptor
func (*Descriptor) GetResource ¶
func (x *Descriptor) GetResource() string
func (*Descriptor) ProtoMessage ¶
func (*Descriptor) ProtoMessage()
func (*Descriptor) ProtoReflect ¶
func (x *Descriptor) ProtoReflect() protoreflect.Message
func (*Descriptor) Reset ¶
func (x *Descriptor) Reset()
func (*Descriptor) String ¶
func (x *Descriptor) String() string
type FieldDescriptor ¶
type FieldDescriptor struct {
// name is the wire field name referenced by Condition.field and Sort.field.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// type drives value parsing/validation and which operators are valid.
Type FieldType `protobuf:"varint,2,opt,name=type,proto3,enum=query.v1.FieldType" json:"type,omitempty"`
// operators lists the operators valid for this specific field. A Condition
// using an operator not in this list must be rejected by the server.
Operators []Operator `protobuf:"varint,4,rep,packed,name=operators,proto3,enum=query.v1.Operator" json:"operators,omitempty"`
// contains filtered or unexported fields
}
FieldDescriptor describes a single queryable/sortable field of a resource.
func (*FieldDescriptor) Descriptor
deprecated
func (*FieldDescriptor) Descriptor() ([]byte, []int)
Deprecated: Use FieldDescriptor.ProtoReflect.Descriptor instead.
func (*FieldDescriptor) GetName ¶
func (x *FieldDescriptor) GetName() string
func (*FieldDescriptor) GetOperators ¶
func (x *FieldDescriptor) GetOperators() []Operator
func (*FieldDescriptor) GetType ¶
func (x *FieldDescriptor) GetType() FieldType
func (*FieldDescriptor) ProtoMessage ¶
func (*FieldDescriptor) ProtoMessage()
func (*FieldDescriptor) ProtoReflect ¶
func (x *FieldDescriptor) ProtoReflect() protoreflect.Message
func (*FieldDescriptor) Reset ¶
func (x *FieldDescriptor) Reset()
func (*FieldDescriptor) String ¶
func (x *FieldDescriptor) String() string
type FieldType ¶
type FieldType int32
FieldType is the value type of a queryable field. It drives value parsing and which operators are valid against the field.
func (FieldType) Descriptor ¶
func (FieldType) Descriptor() protoreflect.EnumDescriptor
func (FieldType) EnumDescriptor
deprecated
func (FieldType) Number ¶
func (x FieldType) Number() protoreflect.EnumNumber
func (FieldType) Type ¶
func (FieldType) Type() protoreflect.EnumType
type FilterOp ¶
type FilterOp int32
FilterOp combines multiple conditions in a Filters group.
func (FilterOp) Descriptor ¶
func (FilterOp) Descriptor() protoreflect.EnumDescriptor
func (FilterOp) EnumDescriptor
deprecated
func (FilterOp) Number ¶
func (x FilterOp) Number() protoreflect.EnumNumber
func (FilterOp) Type ¶
func (FilterOp) Type() protoreflect.EnumType
type Filters ¶
type Filters struct {
Op FilterOp `protobuf:"varint,1,opt,name=op,proto3,enum=query.v1.FilterOp" json:"op,omitempty"`
Conditions []*Condition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"`
// contains filtered or unexported fields
}
Filters combines one or more conditions with a single combinator. Nested groups are not supported.
func (*Filters) Descriptor
deprecated
func (*Filters) GetConditions ¶
func (*Filters) ProtoMessage ¶
func (*Filters) ProtoMessage()
func (*Filters) ProtoReflect ¶
func (x *Filters) ProtoReflect() protoreflect.Message
type Operator ¶
type Operator int32
Operator is a comparison or match operator usable in a query Condition.
const ( Operator_OPERATOR_UNSPECIFIED Operator = 0 // OPERATOR_EQ is equals. On a FIELD_TYPE_STRING field, the value may // contain glob wildcards ("*" for any run of characters, "?" for any // single character) for substring/prefix/suffix matching; a value with no // wildcards is a case-insensitive exact match. Non-string fields always // use strict equality. Operator_OPERATOR_EQ Operator = 1 // OPERATOR_NE is not equals, with the same glob-wildcard support as // OPERATOR_EQ on FIELD_TYPE_STRING fields. Operator_OPERATOR_NE Operator = 2 Operator_OPERATOR_IN Operator = 4 // value is one of a set (exact match; no wildcard support) Operator_OPERATOR_GT Operator = 5 // greater than Operator_OPERATOR_GTE Operator = 6 // greater than or equal Operator_OPERATOR_LT Operator = 7 // less than Operator_OPERATOR_LTE Operator = 8 // less than or equal Operator_OPERATOR_EXISTS Operator = 9 // field is set / not null )
func (Operator) Descriptor ¶
func (Operator) Descriptor() protoreflect.EnumDescriptor
func (Operator) EnumDescriptor
deprecated
func (Operator) Number ¶
func (x Operator) Number() protoreflect.EnumNumber
func (Operator) Type ¶
func (Operator) Type() protoreflect.EnumType
type Page ¶
type Page struct {
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
// contains filtered or unexported fields
}
Page requests a limit/offset window of results.
func (*Page) Descriptor
deprecated
func (*Page) ProtoMessage ¶
func (*Page) ProtoMessage()
func (*Page) ProtoReflect ¶
func (x *Page) ProtoReflect() protoreflect.Message
type Payload ¶
type Payload struct {
// filters is left unset for "no filter".
Filters *Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"`
// sort overrides the resource's default_sort when non-empty.
Sort []*Sort `protobuf:"bytes,2,rep,name=sort,proto3" json:"sort,omitempty"`
// page requests a limit/offset window; unset means the resource's own
// default paging behavior applies.
Page *Page `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"`
// obligations carries the authz obligations map from the policy
// evaluation that authorized this request, verbatim (see
// common/pkg/authz ObligationKey*/Parse*Obligation). Gateways populate
// this after authz evaluation — it is never client-supplied. The
// resource-owning service must enforce it as a mandatory constraint
// ANDed onto the query, independent of Filters.op.
Obligations map[string]string `` /* 149-byte string literal not displayed */
// contains filtered or unexported fields
}
Payload is a client-issued query against a resource's queryable fields, sent alongside a resource's normal list/get request.
func (*Payload) Descriptor
deprecated
func (*Payload) GetFilters ¶
func (*Payload) GetObligations ¶
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
func (*Payload) ProtoReflect ¶
func (x *Payload) ProtoReflect() protoreflect.Message
type Sort ¶
type Sort struct {
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Dir SortDir `protobuf:"varint,2,opt,name=dir,proto3,enum=query.v1.SortDir" json:"dir,omitempty"`
// contains filtered or unexported fields
}
Sort orders results by a single field.
func (*Sort) Descriptor
deprecated
func (*Sort) ProtoMessage ¶
func (*Sort) ProtoMessage()
func (*Sort) ProtoReflect ¶
func (x *Sort) ProtoReflect() protoreflect.Message
type SortDir ¶
type SortDir int32
SortDir is the sort direction for a single sort key.
func (SortDir) Descriptor ¶
func (SortDir) Descriptor() protoreflect.EnumDescriptor
func (SortDir) EnumDescriptor
deprecated
func (SortDir) Number ¶
func (x SortDir) Number() protoreflect.EnumNumber
func (SortDir) Type ¶
func (SortDir) Type() protoreflect.EnumType