Documentation ¶
Index ¶
- func NewData[T any](c echo.Context, code int, data T) error
- func NewError(c echo.Context, err error) error
- func NewErrorCode(c echo.Context, err error, code int) error
- func NewPageData[T any](c echo.Context, code int, pageSet *pager.PageSet[T]) error
- type DataResponse
- type ErrorResponse
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorCode ¶
Types ¶
type DataResponse ¶
type DataResponse[T any] struct { Data T `json:"data"` Pagination *Pagination `json:"page,omitempty"` }
type ErrorResponse ¶
type ErrorResponse struct {
Error any `json:"error,omitempty"`
}
type Pagination ¶
type Pagination struct { Current int64 `json:"current"` Total int64 `json:"total"` Elements int64 `json:"elements"` Remaining int64 `json:"remaining"` HasNextPage bool `json:"hasNextPage"` }
func NewPagination ¶
func NewPagination[T any](pageSet *pager.PageSet[T]) Pagination
Click to show internal directories.
Click to hide internal directories.