Documentation
¶
Index ¶
- Variables
- type Distinct
- type Field
- func (f Field) Ascending() *Order
- func (f Field) Descending() *Order
- func (f Field) Distinct() *Distinct
- func (f Field) Equal(value interface{}) *Filter
- func (f Field) GreaterOrEqual(value interface{}) *Filter
- func (f Field) GreaterThan(value interface{}) *Filter
- func (f Field) LessOrEqual(value interface{}) *Filter
- func (f Field) LessThan(value interface{}) *Filter
- func (f Field) NotEqual(value interface{}) *Filter
- type FieldMapper
- type Filter
- type Logical
- type LogicalOperator
- type Operator
- type Option
- type OptionType
- type Order
- type QueryBuilder
- type SortOrder
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyFieldMapper = make(FieldMapper)
Functions ¶
This section is empty.
Types ¶
type Distinct ¶ added in v0.2.8
type Distinct struct {
Field Field
}
func (Distinct) OptionType ¶ added in v0.2.8
func (d Distinct) OptionType() OptionType
type Field ¶
type Field string
func (Field) Descending ¶
func (Field) GreaterOrEqual ¶
func (Field) GreaterThan ¶
func (Field) LessOrEqual ¶
type FieldMapper ¶
func (*FieldMapper) Get ¶
func (m *FieldMapper) Get(field Field) string
func (*FieldMapper) Map ¶ added in v0.2.10
func (m *FieldMapper) Map(fields []Field) []string
type Filter ¶
func (*Filter) OptionType ¶
func (f *Filter) OptionType() OptionType
type Logical ¶
type Logical struct {
Operator LogicalOperator
Filters []Option // Filter or Logical
}
func (*Logical) OptionType ¶
func (l *Logical) OptionType() OptionType
type LogicalOperator ¶
type LogicalOperator string
const ( OpAnd LogicalOperator = "and" OpOr LogicalOperator = "or" OpNot LogicalOperator = "not" )
type OptionType ¶
type OptionType int
const ( OptionTypeFilter OptionType = iota OptionTypeLogical OptionTypeSort OptionTypeDistinct )
type Order ¶
func (Order) OptionType ¶
func (o Order) OptionType() OptionType
type QueryBuilder ¶
type QueryBuilder[T any] interface { Build(options ...Option) T WithFieldMapper(mapper FieldMapper) QueryBuilder[T] }
QueryBuilder is a function that takes a filter and returns a new filter
Click to show internal directories.
Click to hide internal directories.