Documentation ¶
Index ¶
- type ErrorDetail
- type ResponseFail
- func NewResponseBadRequest(message string) (int, ResponseFail)
- func NewResponseBadRequestWithDetail(message, errorCode string, errors map[string]string) (int, ResponseFail)
- func NewResponseFail(httpCode int, message string, details ErrorDetail) (int, ResponseFail)
- func NewResponseInternalServerError(message string) (int, ResponseFail)
- type ResponseSuccess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorDetail ¶
type ResponseFail ¶
type ResponseFail struct { HttpCode int `json:"http_code"` Message string `json:"message"` Details ErrorDetail `json:"details"` }
func NewResponseBadRequest ¶
func NewResponseBadRequest(message string) (int, ResponseFail)
func NewResponseBadRequestWithDetail ¶
func NewResponseBadRequestWithDetail(message, errorCode string, errors map[string]string) (int, ResponseFail)
func NewResponseFail ¶
func NewResponseFail(httpCode int, message string, details ErrorDetail) (int, ResponseFail)
func NewResponseInternalServerError ¶
func NewResponseInternalServerError(message string) (int, ResponseFail)
type ResponseSuccess ¶
type ResponseSuccess[T any] struct { HttpCode int `json:"http_code"` Message string `json:"message"` Content T `json:"content"` }
func NewResponseOK ¶
func NewResponseOK[T any](message string, content T) (int, ResponseSuccess[T])
func NewResponseSuccess ¶
func NewResponseSuccess[T any](httpCode int, message string, content T) (int, ResponseSuccess[T])
Click to show internal directories.
Click to hide internal directories.