Documentation ¶
Index ¶
- Variables
- type Condition
- func (*Condition) Descriptor() ([]byte, []int)deprecated
- func (x *Condition) GetFieldName() string
- func (x *Condition) GetFilterOperator() string
- func (x *Condition) GetNot() bool
- func (x *Condition) GetOperator() Operator
- func (x *Condition) GetValue() string
- func (*Condition) ProtoMessage()
- func (x *Condition) ProtoReflect() protoreflect.Message
- func (x *Condition) Reset()
- func (x *Condition) String() string
- type Direction
- type Filter
- func (q *Filter) AddCondition(condition *Condition) *Filter
- func (q *Filter) AddOrderBy(field string, direction Direction) *Filter
- func (q *Filter) Contains(field, value string) *Filter
- func (*Filter) Descriptor() ([]byte, []int)deprecated
- func (q *Filter) Eq(field string, value interface{}) *Filter
- func (q *Filter) From(tableName string) *Filter
- func (q *Filter) FullSearch(value any, fields ...string) *Filter
- func (x *Filter) GetConditions() []*Condition
- func (x *Filter) GetFirst() int64
- func (x *Filter) GetIds() []string
- func (x *Filter) GetIgnoreSoftDelete() bool
- func (x *Filter) GetLast() int64
- func (x *Filter) GetLimit() int64
- func (x *Filter) GetMainFilter() string
- func (x *Filter) GetOrconditions() []*Condition
- func (x *Filter) GetOrderBy() []*OrderBy
- func (x *Filter) GetRawFilter() string
- func (x *Filter) GetSelectFields() []string
- func (x *Filter) GetSkip() int64
- func (q *Filter) Gt(field string, value interface{}) *Filter
- func (q *Filter) Gte(field string, value interface{}) *Filter
- func (q *Filter) In(field string, value ...interface{}) *Filter
- func (q *Filter) Lt(field string, value interface{}) *Filter
- func (q *Filter) Lte(field string, value interface{}) *Filter
- func (q *Filter) Ne(field string, value interface{}) *Filter
- func (q *Filter) NotIn(field string, value ...*anypb.Any) *Filter
- func (q *Filter) OrderByAsc(field string) *Filter
- func (q *Filter) OrderByDesc(field string) *Filter
- func (*Filter) ProtoMessage()
- func (x *Filter) ProtoReflect() protoreflect.Message
- func (x *Filter) Reset()
- func (q *Filter) Select(field ...string) *Filter
- func (q *Filter) StartsOrContain(field, value string) *Filter
- func (q *Filter) StartsWith(field, value string) *Filter
- func (x *Filter) String() string
- type Operator
- type OrderBy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Direction_name = map[int32]string{ 0: "ASC", 1: "DESC", } Direction_value = map[string]int32{ "ASC": 0, "DESC": 1, } )
Enum value maps for Direction.
View Source
var ( Operator_name = map[int32]string{ 0: "Equals", 1: "Contains", 2: "Starts", 3: "In", 4: "Gt", 5: "Gte", 6: "Lt", 7: "Lte", } Operator_value = map[string]int32{ "Equals": 0, "Contains": 1, "Starts": 2, "In": 3, "Gt": 4, "Gte": 5, "Lt": 6, "Lte": 7, } )
Enum value maps for Operator.
View Source
var File_filter_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` Operator Operator `protobuf:"varint,2,opt,name=operator,proto3,enum=Operator" json:"operator,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Not bool `protobuf:"varint,4,opt,name=not,proto3" json:"not,omitempty"` FilterOperator string `protobuf:"bytes,5,opt,name=filter_operator,json=filterOperator,proto3" json:"filter_operator,omitempty"` // contains filtered or unexported fields }
func (*Condition) Descriptor
deprecated
func (*Condition) GetFieldName ¶
func (*Condition) GetFilterOperator ¶
func (*Condition) GetOperator ¶
func (*Condition) ProtoMessage ¶
func (*Condition) ProtoMessage()
func (*Condition) ProtoReflect ¶
func (x *Condition) ProtoReflect() protoreflect.Message
type Direction ¶
type Direction int32
func (Direction) Descriptor ¶
func (Direction) Descriptor() protoreflect.EnumDescriptor
func (Direction) EnumDescriptor
deprecated
func (Direction) Number ¶
func (x Direction) Number() protoreflect.EnumNumber
func (Direction) Type ¶
func (Direction) Type() protoreflect.EnumType
type Filter ¶
type Filter struct { MainFilter string `protobuf:"bytes,1,opt,name=main_filter,json=mainFilter,proto3" json:"main_filter,omitempty"` SelectFields []string `protobuf:"bytes,2,rep,name=select_fields,json=selectFields,proto3" json:"select_fields,omitempty"` Ids []string `protobuf:"bytes,3,rep,name=ids,proto3" json:"ids,omitempty"` Conditions []*Condition `protobuf:"bytes,4,rep,name=conditions,proto3" json:"conditions,omitempty"` Orconditions []*Condition `protobuf:"bytes,5,rep,name=Orconditions,proto3" json:"Orconditions,omitempty"` OrderBy []*OrderBy `protobuf:"bytes,6,rep,name=orderBy,proto3" json:"orderBy,omitempty"` Limit int64 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` Skip int64 `protobuf:"varint,8,opt,name=skip,proto3" json:"skip,omitempty"` First int64 `protobuf:"varint,9,opt,name=first,proto3" json:"first,omitempty"` Last int64 `protobuf:"varint,10,opt,name=last,proto3" json:"last,omitempty"` // // free field to be sent filter compatible with Filter implementation RawFilter string `protobuf:"bytes,11,opt,name=rawFilter,proto3" json:"rawFilter,omitempty"` // // add raw conditions to be sent to Filter implementation // string rawConditions = 11; // // // this field can be used to add "additional conditions", similar to where clause in SQL language // repeated string additionalConditions = 12; // // some implementations use soft delete, this field would help the Filter implementation to decide how the filter // // including records "deleted" IgnoreSoftDelete bool `protobuf:"varint,12,opt,name=ignoreSoftDelete,proto3" json:"ignoreSoftDelete,omitempty"` // contains filtered or unexported fields }
generic filter API specification
func (*Filter) AddCondition ¶
func (*Filter) Descriptor
deprecated
func (*Filter) FullSearch ¶
FullSearch is a special function to search by many fields at once using OR logical Operator
func (*Filter) GetConditions ¶
func (*Filter) GetIgnoreSoftDelete ¶
func (*Filter) GetMainFilter ¶
func (*Filter) GetOrconditions ¶
func (*Filter) GetOrderBy ¶
func (*Filter) GetRawFilter ¶
func (*Filter) GetSelectFields ¶
func (*Filter) OrderByAsc ¶
func (*Filter) OrderByDesc ¶
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
func (*Filter) ProtoReflect ¶
func (x *Filter) ProtoReflect() protoreflect.Message
func (*Filter) StartsOrContain ¶
StartsOrContain funcao para consultar comecando com ou contendo o valor, se houver * no valor, ele consulta por contém, caso contrário consulta por start
func (*Filter) StartsWith ¶
type Operator ¶
type Operator int32
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 OrderBy ¶
type OrderBy struct { FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=Direction" json:"direction,omitempty"` // contains filtered or unexported fields }
func (*OrderBy) Descriptor
deprecated
func (*OrderBy) GetDirection ¶
func (*OrderBy) GetFieldName ¶
func (*OrderBy) ProtoMessage ¶
func (*OrderBy) ProtoMessage()
func (*OrderBy) ProtoReflect ¶
func (x *OrderBy) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.