Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pagination ¶
type Pagination struct { Size int `json:"size,omitempty"` Page int `json:"page,omitempty"` Total int64 `json:"total,omitempty"` Offset int `json:"-"` Sorts []SortItem `json:"-"` }
func PaginationFromQuery ¶
func PaginationFromQuery(req *http.Request) *Pagination
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() int
func (*Pagination) GetPageNum ¶
func (p *Pagination) GetPageNum() int
func (*Pagination) GetPageSize ¶
func (p *Pagination) GetPageSize() int
func (*Pagination) GetSorts ¶
func (p *Pagination) GetSorts() []SortItem
func (*Pagination) SetTotal ¶
func (p *Pagination) SetTotal(total int64)
type Response ¶
type Response struct { Code int `json:"code"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Data any `json:"data,omitempty"` Pagination }
func NewResponse ¶
func ResponseOK ¶
func ResponseOK() *Response
func (*Response) WithMessage ¶
func (*Response) WithPagination ¶
func (r *Response) WithPagination(pagination *Pagination) *Response
Click to show internal directories.
Click to hide internal directories.