Documentation ¶
Overview ¶
Package response provides the response and error handling types support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
Error is used to pass an error during the request through the application with web specific context.
type ErrorDocument ¶
type ErrorDocument struct { Error string `json:"error"` Fields map[string]string `json:"fields,omitempty"` }
ErrorDocument is the form used for API responses from failures in the API.
type PageDocument ¶
type PageDocument[T any] struct { Items []T `json:"items"` Total int `json:"total"` Page int `json:"page"` RowsPerPage int `json:"rowsPerPage"` }
PageDocument is the form used for API responses from query API calls.
func NewPageDocument ¶
func NewPageDocument[T any](items []T, total int, page int, rowsPrePage int) PageDocument[T]
NewPageDocument constructs a response value for a web paging response.
Click to show internal directories.
Click to hide internal directories.