Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterOption ¶ added in v1.0.2
type FilterOption struct { Name filter.ReadableValue[string] `json:"name" binding:"required"` Control filter.RequestOptionType `json:"control" binding:"required"` Operators []filter.ReadableValue[filter.CompareOperator] `json:"operators" binding:"required"` Values []string `json:"values,omitempty"` MultiSelect bool `json:"multiSelect" binding:"required"` }
FilterOption hold the information for a filter option. It can be used by a client to determine possible filters.
Name: The name of the option Control: The type of control for the option Operators: The list of comparison operators for the option Values: The possible values for the option MultiSelect: Indicates whether the option supports multiple selections
type Metadata ¶
type Metadata struct { Filter *filter.Request `json:"filter,omitempty"` Paging *paging.Response `json:"paging,omitempty"` Sorting *sorting.Request `json:"sorting,omitempty"` }
Metadata represents the metadata used in a query.
func NewMetadata ¶
func NewMetadata(resultSelector ResultSelector, totalRowCount uint64) Metadata
type ResponseListWithMetadata ¶
type ResponseListWithMetadata[T any] struct { Metadata Metadata `json:"metadata" binding:"required"` Data []T `json:"data" binding:"required"` }
ResponseListWithMetadata represents a response containing a list of data with associated metadata. The 'Metadata' field is of type 'Metadata' includes filter, paging, and sorting information used in the query. The 'Data' field is a slice of type 'T' and represents the data retrieved.
type ResponseWithMetadata ¶
type ResponseWithMetadata[T any] struct { Metadata Metadata `json:"metadata" binding:"required"` Data T `json:"data" binding:"required"` }
ResponseWithMetadata represents a response with associated metadata. The metadata includes filter, paging, and sorting information. The 'Metadata' field is of type 'Metadata' includes filter, paging, and sorting information used in the query. The 'Data' field is of any type and represents the data retrieved by the query.
type ResultSelector ¶
type ResultSelector struct { Filter *filter.Request `json:"filter" binding:"omitempty"` Sorting *sorting.Request `json:"sorting" binding:"omitempty"` Paging *paging.Request `json:"paging" binding:"omitempty"` }
ResultSelector is a type that represents the selection criteria for querying data. It contains a filter, sorting, and paging information. Filter is a pointer to a filter.Request struct that specifies the filtering criteria for the query. Sorting is a pointer to a sorting.Request struct that specifies the sorting order for the query. Paging is a pointer to a paging.Request struct that specifies the paging configuration for the query.