Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Message string `json:"message" example:"invalid id"` Field string `json:"field,omitempty" example:"id"` Value any `json:"value,omitempty"` }
func NewAPIError ¶
func NewAPIErrorWithField ¶
func NewAPIErrorWithValue ¶
type APIErrorResponse ¶
type APIErrorResponse struct {
Errors []APIError
}
type APIResponse ¶
type APIResponse interface{}
func NewAPIErrorResponse ¶
func NewAPIErrorResponse(errors []APIError) APIResponse
type APIResponseEnvelope ¶
type APIResponseEnvelope struct {
// contains filtered or unexported fields
}
func NewEnvelope ¶
func NewEnvelope(status int, options ...ResponseEnvelopeOption) *APIResponseEnvelope
func NewWithResponse ¶
func NewWithResponse(status int, payload APIResponse) *APIResponseEnvelope
func (APIResponseEnvelope) Response ¶
func (r APIResponseEnvelope) Response() APIResponse
func (APIResponseEnvelope) Status ¶
func (r APIResponseEnvelope) Status() int
type PageableResponse ¶
type PageableResponse[T any] struct { Content []T Empty bool Number int NumberOfElements int TotalElements int TotalPages int }
func NewPageableResponse ¶
type ResponseEnvelopeOption ¶
type ResponseEnvelopeOption func(envelop *APIResponseEnvelope)
func WithResponse ¶
func WithResponse(response APIResponse) ResponseEnvelopeOption
Click to show internal directories.
Click to hide internal directories.