annotationspb

package
v0.0.0-...-9fa10a5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FieldQueryOption_name = map[int32]string{
		0: "FIELD_QUERY_BEHAVIOR_UNSPECIFIED",
		1: "FORBID_FILTERING",
		2: "FORBID_SORTING",
		3: "NO_TEXT_SEARCH",
		4: "NON_TRAVERSAL",
	}
	FieldQueryOption_value = map[string]int32{
		"FIELD_QUERY_BEHAVIOR_UNSPECIFIED": 0,
		"FORBID_FILTERING":                 1,
		"FORBID_SORTING":                   2,
		"NO_TEXT_SEARCH":                   3,
		"NON_TRAVERSAL":                    4,
	}
)

Enum value maps for FieldQueryOption.

View Source
var (
	// Defines query specification that the field supports.
	// Can be used multiple times to precisely define the query behavior.
	//
	// repeated blocky.api.FieldQueryOption query_opt = 20364997;
	E_QueryOpt = &file_blocky_api_annotations_proto_extTypes[1]
	// Defines the complexity at which the server serves queries
	// on this field (i.e. filtering or sorting).
	// This can be useful for a query complexity calculation.
	//
	// optional int64 complexity = 20364998;
	E_Complexity = &file_blocky_api_annotations_proto_extTypes[2]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional blocky.api.MessageProperties properties = 20364999;
	E_Properties = &file_blocky_api_annotations_proto_extTypes[3]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// Defines the query parameters for a message.
	// The pagination defines pagination behavior for the message.
	//
	// Examples:
	//
	//	message ListPeopleRequest {
	//	  option (query_params) = {
	//	    pagination: {
	//	      max_size: 100,
	//	      default_size: 10,
	//	    },
	//	    order_by: "name, age desc",
	//	    max_complexity: 1000,
	//	    resource: "people",
	//	  };
	//
	//	message Person {
	//	  string name = 1;
	//	  int32 age = 2;
	//	}
	//
	// optional blocky.api.QueryParameters query_params = 20364996;
	E_QueryParams = &file_blocky_api_annotations_proto_extTypes[0]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_blocky_api_annotations_proto protoreflect.FileDescriptor
View Source
var File_blocky_api_message_properties_proto protoreflect.FileDescriptor
View Source
var File_blocky_api_query_parameters_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FieldQueryOption

type FieldQueryOption int32

Defines the query behavior for a field.

const (
	// Unspecified field filter behavior, do not use.
	FieldQueryOption_FIELD_QUERY_BEHAVIOR_UNSPECIFIED FieldQueryOption = 0
	// Field forbids filtering.
	FieldQueryOption_FORBID_FILTERING FieldQueryOption = 1
	// Field forbids sorting.
	FieldQueryOption_FORBID_SORTING FieldQueryOption = 2
	// NO_TEXT_SEARCH forbids text search on the field.
	FieldQueryOption_NO_TEXT_SEARCH FieldQueryOption = 3
	// NON_TRAVERSAL forbids traversal on the field.
	FieldQueryOption_NON_TRAVERSAL FieldQueryOption = 4
)

func (FieldQueryOption) Descriptor

func (FieldQueryOption) Enum

func (FieldQueryOption) EnumDescriptor deprecated

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

Deprecated: Use FieldQueryOption.Descriptor instead.

func (FieldQueryOption) Number

func (FieldQueryOption) String

func (x FieldQueryOption) String() string

func (FieldQueryOption) Type

type MessageProperties

type MessageProperties struct {

	// States that given message is comparable to other messages of the same type.
	Comparable bool `protobuf:"varint,1,opt,name=comparable,proto3" json:"comparable,omitempty"`
	// contains filtered or unexported fields
}

MessageProperties is used to annotate messages with additional information. This information can be used by generators to generate code that is more suitable for the given message. It also allows to specify some properties that are not part of the protobuf specification.

func (*MessageProperties) Descriptor deprecated

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

Deprecated: Use MessageProperties.ProtoReflect.Descriptor instead.

func (*MessageProperties) GetComparable

func (x *MessageProperties) GetComparable() bool

func (*MessageProperties) ProtoMessage

func (*MessageProperties) ProtoMessage()

func (*MessageProperties) ProtoReflect

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

func (*MessageProperties) Reset

func (x *MessageProperties) Reset()

func (*MessageProperties) String

func (x *MessageProperties) String() string

type Pagination

type Pagination struct {

	// Is the page size.
	MaxSize int64 `protobuf:"varint,1,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"`
	// Default page size.
	DefaultSize int64 `protobuf:"varint,2,opt,name=default_size,json=defaultSize,proto3" json:"default_size,omitempty"`
	// contains filtered or unexported fields
}

Pagination defines the maximum page size for a message.

func (*Pagination) Descriptor deprecated

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

Deprecated: Use Pagination.ProtoReflect.Descriptor instead.

func (*Pagination) GetDefaultSize

func (x *Pagination) GetDefaultSize() int64

func (*Pagination) GetMaxSize

func (x *Pagination) GetMaxSize() int64

func (*Pagination) ProtoMessage

func (*Pagination) ProtoMessage()

func (*Pagination) ProtoReflect

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

func (*Pagination) Reset

func (x *Pagination) Reset()

func (*Pagination) String

func (x *Pagination) String() string

type QueryParameters

type QueryParameters struct {

	// Pagination parameters that are specific to this message.
	Pagination *Pagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	// Is a default sorting order of the query.
	// The string format is defined in: https://aip.dev/132#ordering
	// Example:
	//
	//	"name desc, create_time"
	OrderBy string `protobuf:"bytes,2,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	// An abstract maximum complexity of the filter that this
	// message supports.
	// This can be used to calculate the complexity of a filter.
	// If served query complexity exceeds this value, the server
	// may return an error with grpc code RESOURCE_EXHAUSTED.
	MaxComplexity int64 `protobuf:"varint,3,opt,name=max_complexity,json=maxComplexity,proto3" json:"max_complexity,omitempty"`
	// The name of the response field that contains resulting
	// resources.
	// This by default is a lower case plural of the resource name.
	// Example:
	//
	//	service FooService {
	//	  rpc ListFoos(ListFoosRequest) returns (ListFoosResponse){
	//	    option (blocky.api.query_params) = {
	//	      results: "foos"
	//	    };
	//
	//	message ListFoosResponse {
	//	  repeated Foo foos = 1;
	//	}
	//	The default value of this field is "foos".
	//
	// This field might be really useful for non-standard
	// pluralization rules i.e. "foos" -> "foo_list".
	Results string `protobuf:"bytes,4,opt,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

QueryParameters defines the query parameters for a message.

func (*QueryParameters) Descriptor deprecated

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

Deprecated: Use QueryParameters.ProtoReflect.Descriptor instead.

func (*QueryParameters) GetMaxComplexity

func (x *QueryParameters) GetMaxComplexity() int64

func (*QueryParameters) GetOrderBy

func (x *QueryParameters) GetOrderBy() string

func (*QueryParameters) GetPagination

func (x *QueryParameters) GetPagination() *Pagination

func (*QueryParameters) GetResults

func (x *QueryParameters) GetResults() string

func (*QueryParameters) ProtoMessage

func (*QueryParameters) ProtoMessage()

func (*QueryParameters) ProtoReflect

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

func (*QueryParameters) Reset

func (x *QueryParameters) Reset()

func (*QueryParameters) String

func (x *QueryParameters) String() string

Jump to

Keyboard shortcuts

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