Documentation
¶
Index ¶
- Constants
- type Page
- func (p *Page) Add(key string, value ...string) *Page
- func (p *Page) ApplyDefault(key string, values ...string) *Page
- func (p *Page) ApplyPageNumber(num, limit int) *Page
- func (p *Page) Bool(key string) bool
- func (p *Page) Clone() *Page
- func (p *Page) CopyFrom(b *Page, keys ...string) *Page
- func (p *Page) Default(key, replacement string) string
- func (p *Page) DefaultBool(key string, replacement bool) bool
- func (p *Page) DefaultInt(key string, replacement int) int
- func (p *Page) Delete(key string) *Page
- func (p *Page) Exists(key string) bool
- func (p *Page) Get(key string) (string, bool)
- func (p *Page) GetBool(key string) (bool, bool)
- func (p *Page) GetBooleans(key string) ([]bool, bool)
- func (p *Page) GetCSV(key string) []string
- func (p *Page) GetInt(key string) (int, bool)
- func (p *Page) GetIntegers(key string) ([]int, bool)
- func (p *Page) GetPageNumber() (int, bool)
- func (p *Page) GetSorts() []string
- func (p *Page) Int(key string) int
- func (p *Page) PageNumber() int
- func (p *Page) Set(key string, values ...string) *Page
- func (p *Page) SetBool(key string, values ...bool) *Page
- func (p *Page) SetCSV(key string, values ...string) *Page
- func (p *Page) SetInt(key string, values ...int) *Page
- func (p *Page) SetSort(sorts ...string) *Page
- func (p *Page) Str(key string) string
Constants ¶
View Source
const ( FieldPage = "page" FieldLimit = "limit" FieldOffset = "offset" FieldSort = "sort" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct {
Fields map[string][]string
// Count is used to determine the amount of results returned from the query.
Count int
// Limit is used to determine the total amount requested for the query.
Limit int
// Offset is used to determine where the cursor in the query should start.
Offset int
// Total is used to tell how many total results are available to query. A value of 0 or less can be considered as
// unset.
Total int
}
Count, Limit, Offset, Total are used for setting results of a query. The query performed may change any of these properties due to limitations or desired logic.
func NewPageFromMap ¶
func (*Page) ApplyPageNumber ¶
func (*Page) GetPageNumber ¶
This is special logic that is commonly used. The page number should be 1 to infinity in any instance thus we use this logic throughout applications.
func (*Page) PageNumber ¶
Click to show internal directories.
Click to hide internal directories.