Versions in this module Expand all Collapse all v1 v1.0.0 Feb 1, 2024 Changes in this version + const JsonRespMode + const MsgRespMode + var FastResponseOption = &FastResponseOptionType + var GetMessageToStatus func(status int) string = nil + var RespAdvancedOption func(t *FastResponse, m *map[string]any) = nil + var RespErrorMsg = false + var VerifyDefaultErrMsgResp = func(r *ghttp.Request, err gvalid.Error) + var VerifyDefaultMsgNilResp = func(r *ghttp.Request) + func FastRespJsonConfigOn() (err error) + func GetCtxVar(ctx context.Context, key any, def ...any) *gvar.Var + func SetCtxVar(ctx context.Context, key, value any) context.Context + func VerifyDataToJson(r *ghttp.Request, i VerifyHandlerInterface) *gjson.Json + func VerifyDataToStruct[T VerifyHandlerInterface](r *ghttp.Request, i T) T + func VerifyHandler(r *ghttp.Request, i VerifyHandlerInterface) + type FastResponse struct + Data any + Err error + IfMode bool + Msg string + Status int + StatusCode int + func CreateFastResponse(r *ghttp.Request, args ...any) *FastResponse + func FastResp(r *ghttp.Request, args ...any) *FastResponse + func (t *FastResponse) Callback(fn func(t *FastResponse)) *FastResponse + func (t *FastResponse) ErrorStatus() *FastResponse + func (t *FastResponse) GetRequest() *ghttp.Request + func (t *FastResponse) Resp(args ...any) + func (t *FastResponse) Response(args ...any) + func (t *FastResponse) SetData(data any) *FastResponse + func (t *FastResponse) SetMsg(msg string) *FastResponse + func (t *FastResponse) SetRespMode(mode uint8) *FastResponse + func (t *FastResponse) SetStatus(status int) *FastResponse + func (t *FastResponse) SetStatusCode(statusCode int) *FastResponse + func (t *FastResponse) SuccessStatus() *FastResponse + func (t *FastResponse) TxRollBack(tx gdb.TX) *FastResponse + type FastResponseOptionType struct + CodeName string + DataName string + DefaultErrorCode int + DefaultErrorStatusCode int + DefaultSuccessCode int + DefaultSuccessStatusCode int + ErrorMsg string + MsgName string + SuccessMsg string + TimeName string + type VerifyHandlerInterface interface + Message func() map[string]string + Rules func(r *ghttp.Request) map[string]string