Documentation ¶
Index ¶
- func Decode(strct interface{}, values Values) error
- func Filters(values Values) func(*orm.Query) (*orm.Query, error)
- func Pagination(values Values) func(*orm.Query) (*orm.Query, error)
- type Filter
- type Pager
- type Values
- func (v Values) Bool(name string) (bool, error)
- func (v Values) Duration(name string) (time.Duration, error)
- func (v Values) Float64(name string) (float64, error)
- func (v Values) Has(name string) bool
- func (v Values) Int(name string) (int, error)
- func (v Values) Int64(name string) (int64, error)
- func (v Values) MaybeBool(name string) bool
- func (v Values) MaybeDuration(name string) time.Duration
- func (v Values) MaybeFloat64(name string) float64
- func (v Values) MaybeInt(name string) int
- func (v Values) MaybeInt64(name string) int64
- func (v Values) MaybeTime(name string) time.Time
- func (v Values) Pager() *Pager
- func (v Values) SetDefault(name string, values ...string)
- func (v Values) String(name string) string
- func (v Values) Strings(name string) []string
- func (v Values) Time(name string) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
URLFilter is used with Query.Apply to add WHERE clauses from the URL values:
- ?foo=bar - Where(`"foo" = 'bar'`)
- ?foo=hello&foo=world - Where(`"foo" IN ('hello','world')`)
- ?foo__neq=bar - Where(`"foo" != 'bar'`)
- ?foo__exclude=bar - Where(`"foo" != 'bar'`)
- ?foo__gt=42 - Where(`"foo" > 42`)
- ?foo__gte=42 - Where(`"foo" >= 42`)
- ?foo__lt=42 - Where(`"foo" < 42`)
- ?foo__lte=42 - Where(`"foo" <= 42`)
- ?foo__ieq=bar - Where(`"foo" ILIKE 'bar'`)
- ?foo__match=bar - Where(`"foo" SIMILAR TO 'bar'`)
type Pager ¶
type Pager struct { Limit int Offset int // Default max limit is 1000. MaxLimit int // Default max offset is 1000000. MaxOffset int // contains filtered or unexported fields }
func (*Pager) FromURLValues ¶
func (*Pager) FromValues ¶
Click to show internal directories.
Click to hide internal directories.