Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONError ¶
func JSONError(ctx *fasthttp.RequestCtx, message string, statusCode int, err error)
JSONError creates a JSON-formatted error response and sends it to the client. It takes the fasthttp.RequestCtx, error message, and HTTP status code as parameters.
func JSONSuccess ¶
func JSONSuccess(ctx *fasthttp.RequestCtx, data any, statusCode int)
JSONError creates a JSON-formatted error response and sends it to the client. It takes the fasthttp.RequestCtx, error message, and HTTP status code as parameters.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Message string `json:"message"` Status int `json:"status"` Error error `json:"error"` }
ErrorResponse represents a JSON-formatted error response.
func (*ErrorResponse) MarshalJSON ¶
func (j *ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshal bytes to json - template
func (*ErrorResponse) MarshalJSONBuf ¶
func (j *ErrorResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*ErrorResponse) UnmarshalJSON ¶
func (j *ErrorResponse) UnmarshalJSON(input []byte) error
UnmarshalJSON umarshall json - template of ffjson
func (*ErrorResponse) UnmarshalJSONFFLexer ¶
func (j *ErrorResponse) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
Click to show internal directories.
Click to hide internal directories.