queryv1

package
v0.62.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Condition.ProtoReflect.Descriptor instead.

func (*Condition) GetField

func (x *Condition) GetField() string

func (*Condition) GetOp

func (x *Condition) GetOp() Operator

func (*Condition) GetValues

func (x *Condition) GetValues() []string

func (*Condition) ProtoMessage

func (*Condition) ProtoMessage()

func (*Condition) ProtoReflect

func (x *Condition) ProtoReflect() protoreflect.Message

func (*Condition) Reset

func (x *Condition) Reset()

func (*Condition) String

func (x *Condition) String() string

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.

const (
	FieldType_FIELD_TYPE_UNSPECIFIED FieldType = 0
	FieldType_FIELD_TYPE_STRING      FieldType = 1
	FieldType_FIELD_TYPE_NUMBER      FieldType = 2
	FieldType_FIELD_TYPE_BOOLEAN     FieldType = 3
	FieldType_FIELD_TYPE_DATETIME    FieldType = 4
)

func (FieldType) Descriptor

func (FieldType) Descriptor() protoreflect.EnumDescriptor

func (FieldType) Enum

func (x FieldType) Enum() *FieldType

func (FieldType) EnumDescriptor deprecated

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

Deprecated: Use FieldType.Descriptor instead.

func (FieldType) Number

func (x FieldType) Number() protoreflect.EnumNumber

func (FieldType) String

func (x FieldType) String() string

func (FieldType) Type

type FilterOp

type FilterOp int32

FilterOp combines multiple conditions in a Filters group.

const (
	FilterOp_FILTER_OP_UNSPECIFIED FilterOp = 0
	FilterOp_FILTER_OP_AND         FilterOp = 1
	FilterOp_FILTER_OP_OR          FilterOp = 2
)

func (FilterOp) Descriptor

func (FilterOp) Descriptor() protoreflect.EnumDescriptor

func (FilterOp) Enum

func (x FilterOp) Enum() *FilterOp

func (FilterOp) EnumDescriptor deprecated

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

Deprecated: Use FilterOp.Descriptor instead.

func (FilterOp) Number

func (x FilterOp) Number() protoreflect.EnumNumber

func (FilterOp) String

func (x FilterOp) String() string

func (FilterOp) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Filters.ProtoReflect.Descriptor instead.

func (*Filters) GetConditions

func (x *Filters) GetConditions() []*Condition

func (*Filters) GetOp

func (x *Filters) GetOp() FilterOp

func (*Filters) ProtoMessage

func (*Filters) ProtoMessage()

func (*Filters) ProtoReflect

func (x *Filters) ProtoReflect() protoreflect.Message

func (*Filters) Reset

func (x *Filters) Reset()

func (*Filters) String

func (x *Filters) String() string

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) Enum

func (x Operator) Enum() *Operator

func (Operator) EnumDescriptor deprecated

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

Deprecated: Use Operator.Descriptor instead.

func (Operator) Number

func (x Operator) Number() protoreflect.EnumNumber

func (Operator) String

func (x Operator) String() string

func (Operator) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Page.ProtoReflect.Descriptor instead.

func (*Page) GetLimit

func (x *Page) GetLimit() int32

func (*Page) GetOffset

func (x *Page) GetOffset() int32

func (*Page) ProtoMessage

func (*Page) ProtoMessage()

func (*Page) ProtoReflect

func (x *Page) ProtoReflect() protoreflect.Message

func (*Page) Reset

func (x *Page) Reset()

func (*Page) String

func (x *Page) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Payload.ProtoReflect.Descriptor instead.

func (*Payload) GetFilters

func (x *Payload) GetFilters() *Filters

func (*Payload) GetObligations

func (x *Payload) GetObligations() map[string]string

func (*Payload) GetPage

func (x *Payload) GetPage() *Page

func (*Payload) GetSort

func (x *Payload) GetSort() []*Sort

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) ProtoReflect

func (x *Payload) ProtoReflect() protoreflect.Message

func (*Payload) Reset

func (x *Payload) Reset()

func (*Payload) String

func (x *Payload) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Sort.ProtoReflect.Descriptor instead.

func (*Sort) GetDir

func (x *Sort) GetDir() SortDir

func (*Sort) GetField

func (x *Sort) GetField() string

func (*Sort) ProtoMessage

func (*Sort) ProtoMessage()

func (*Sort) ProtoReflect

func (x *Sort) ProtoReflect() protoreflect.Message

func (*Sort) Reset

func (x *Sort) Reset()

func (*Sort) String

func (x *Sort) String() string

type SortDir

type SortDir int32

SortDir is the sort direction for a single sort key.

const (
	SortDir_SORT_DIR_UNSPECIFIED SortDir = 0
	SortDir_SORT_DIR_ASC         SortDir = 1
	SortDir_SORT_DIR_DESC        SortDir = 2
)

func (SortDir) Descriptor

func (SortDir) Descriptor() protoreflect.EnumDescriptor

func (SortDir) Enum

func (x SortDir) Enum() *SortDir

func (SortDir) EnumDescriptor deprecated

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

Deprecated: Use SortDir.Descriptor instead.

func (SortDir) Number

func (x SortDir) Number() protoreflect.EnumNumber

func (SortDir) String

func (x SortDir) String() string

func (SortDir) Type

func (SortDir) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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