Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvalidError ¶
type InvalidError struct {
// contains filtered or unexported fields
}
func (InvalidError) Error ¶
func (e InvalidError) Error() string
type Page ¶
func NewPageFromRef ¶
NewPageFromRef creates a new Page from pointers to pageNumber and pageSize. Useful for handling query parameters.
type PagedResponse ¶
type PagedResponse[T any] struct { Page Page `json:"-"` TotalCount int `json:"totalCount"` Items []T `json:"items"` }
func MapPagedResponse ¶
func MapPagedResponse[Out any, In any](resp PagedResponse[In], m func(in In) Out) PagedResponse[Out]
MapPagedResponse creates a new PagedResponse with the given page, totalCount and items.
func MapPagedResponseError ¶
func MapPagedResponseError[Out any, In any](resp PagedResponse[In], m func(in In) (Out, error)) (PagedResponse[Out], error)
MapPagedResponseError is similar to MapPagedResponse but it allows the mapping function to return an error.
func (PagedResponse[T]) MarshalJSON ¶
func (p PagedResponse[T]) MarshalJSON() ([]byte, error)
Implement json.Marshaler interface to flatten the Page struct
Click to show internal directories.
Click to hide internal directories.