Documentation ¶
Index ¶
- type IError
- type Pagination
- type Response
- func Error(err IError) Response[*int, *int]
- func ErrorExplicit[E any](code string, message string, data E) Response[*int, E]
- func ErrorWithData[E any](err IError, data E) Response[*int, E]
- func Success() Response[*int, *int]
- func SuccessWithData[T any](data T, pagination ...Pagination) Response[T, *int]
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pagination ¶ added in v0.8.10
type Pagination struct { Cursor interface{} `json:"cursor,omitempty"` Total *int64 `json:"total,omitempty"` }
Pagination contains data related to pagination for a request
type Response ¶
type Response[T any, E any] struct { Error *ResponseError[E] `json:"error,omitempty"` Data T `json:"data,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` }
func ErrorExplicit ¶
func SuccessWithData ¶
func SuccessWithData[T any](data T, pagination ...Pagination) Response[T, *int]
type ResponseError ¶
Click to show internal directories.
Click to hide internal directories.