Documentation ¶
Index ¶
- type QueryParams
- func (p *QueryParams) GetFilters() map[string]any
- func (p *QueryParams) Limit() int
- func (p *QueryParams) Offset() int
- func (p *QueryParams) OrderBy() []string
- func (p *QueryParams) SetFilter(name string, value any)
- func (p *QueryParams) SetOrderBy(orderBy []string)
- func (p *QueryParams) SetPagination(page, perPage int)
- func (p *QueryParams) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryParams ¶
type QueryParams struct {
// contains filtered or unexported fields
}
QueryParams for pagination
func NewQueryParamsFromTag ¶
func NewQueryParamsFromTag(ptr any) *QueryParams
NewQueryParamsFromTag create QueryParams from struct
func (*QueryParams) GetFilters ¶
func (p *QueryParams) GetFilters() map[string]any
GetFilters return the filters map
func (*QueryParams) OrderBy ¶
func (p *QueryParams) OrderBy() []string
OrderBy return the order by expression
func (*QueryParams) SetFilter ¶
func (p *QueryParams) SetFilter(name string, value any)
SetFilter add a filter condition
func (*QueryParams) SetOrderBy ¶
func (p *QueryParams) SetOrderBy(orderBy []string)
SetOrderBy set the order by condition
func (*QueryParams) SetPagination ¶
func (p *QueryParams) SetPagination(page, perPage int)
SetPagination set the pagination info
func (*QueryParams) String ¶
func (p *QueryParams) String() string
String return the string representation
Click to show internal directories.
Click to hide internal directories.