Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaginatedResponse ¶
type PaginatedResponse[C any] struct { Items []C `json:"items"` PagingOptions `json:",inline"` Total int64 `json:"total"` }
type PagingOptions ¶
type PagingOptions struct { Offset int64 `query:"offset" json:"offset" validate:"min=0"` Limit int64 `query:"limit" json:"limit" validate:"min=0,max=100"` }
func (PagingOptions) Normalized ¶
func (po PagingOptions) Normalized() PagingOptions
func (PagingOptions) Validate ¶
func (po PagingOptions) Validate() error
type SortDirection ¶
type SortDirection int
const ( DirectionAsc SortDirection = 1 DirectionDesc SortDirection = -1 )
type SortEntry ¶
type SortEntry struct { FieldName string Direction SortDirection }
func NewSortEntry ¶
func NewSortEntry(fieldName string, direction SortDirection) SortEntry
func NewSortEntryFromString ¶
type SortOptions ¶
type SortOptions []SortEntry
func NewSortOptionsFromString ¶
func NewSortOptionsFromString(sorts string, defaultOption ...string) (SortOptions, error)
func (SortOptions) IsEmpty ¶
func (s SortOptions) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.