Documentation ¶
Index ¶
- func JustPrintResp(respBytes []byte, desc string, status int) (int, map[string]string, any, error)
- func ParseRemoteRespJson(respBytes []byte, desc string, status int) (int, map[string]string, any, error)
- func ParseWsRemoteResp(respBytes []byte, desc string, status int) (int, map[string]string, any, error)
- type DbResponse
- type ErrorResponse
- type ErrorState
- type InternalError
- type Receipt
- type ResponseHandler
- type WsRemoteResponse
- type WsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JustPrintResp ¶
func ParseRemoteRespJson ¶
Types ¶
type DbResponse ¶
type ErrorResponse ¶
func FormatErrorResp ¶
func FormatErrorResp(errs error, trans ut.Translator) []ErrorResponse
func GetErrorsArray ¶
func GetErrorsArray(message string, data any) []ErrorResponse
func GetErrorsArrayWithMap ¶
func GetErrorsArrayWithMap(incomingDesc string, data any, errDescList map[string]string) []ErrorResponse
type ErrorState ¶
type ErrorState struct { Source string Input any ErrorDesc string Status int Description string Message any Child error }
func ToErrorState ¶
func ToErrorState(err error) *ErrorState
func (ErrorState) AddInput ¶ added in v0.3.1
func (e ErrorState) AddInput(in string) *ErrorState
func (ErrorState) AddSource ¶ added in v0.3.1
func (e ErrorState) AddSource(src string) *ErrorState
func (ErrorState) Error ¶
func (e ErrorState) Error() string
func (ErrorState) WsResponse ¶
func (e ErrorState) WsResponse() string
type InternalError ¶
func (InternalError) Error ¶
func (e InternalError) Error() string
type ResponseHandler ¶
type ResponseHandler interface { GetErrorsArray(message string, data any) []ErrorResponse HandleErrorState(err error, status int, message string, data any, ctx any) Respond(code, status int, message string, data any, abort bool, ctx any) RespondWithReceipt(code, status int, message string, data any, printData Receipt, abort bool, ctx any) }
type WsRemoteResponse ¶
type WsRemoteResponse struct { Status int `json:"status"` Description string `json:"description"` Result any `json:"result,omitempty"` ErrorData []ErrorResponse `json:"errors,omitempty"` }
func (WsRemoteResponse) ToErrorState ¶ added in v0.1.7
func (e WsRemoteResponse) ToErrorState() *ErrorState
Click to show internal directories.
Click to hide internal directories.