Documentation ¶
Index ¶
Constants ¶
View Source
const ( SuccessMessage string = "success" SuccessCode string = "success-200-s" )
View Source
const ( // 4XX ErrCodeRequestContentTypeNotJSONFormat string = "err-400-rctnjsonf" ErrMessageContentTypeNotJSONFromat string = "Content-Type is not JSON format" ErrCodeRequestContentTypeNotFormDataFormat string = "err-400-rctnfdf" ErrMessageRequestContentTypeNotFormDataFormat string = "Content-Type is not form-data format" ErrCodeRequestQueryParamsNotValid string = "err-400-rqpnv" ErrMessageRequestQueryParamsNotValid string = "request query params is not valid" ErrCodeRequestPayloadCaptchaFieldNotValid string = "err-400-rpcfnv" ErrMessageRequestPayloadCaptchaFieldNotValid string = "captcha not valid" ErrCodeRequestPayloadFieldNotValid string = "err-400-rpfnv" ErrMessageRequestPayloadFieldNotValid string = "request payload some field is not valid" ErrCodeRequestPermissionForbidden string = "err-403-rpf" ErrMessageRequestPermissionForbidden string = "no permission to access" // 5XX ErrCodeServerGeneralFunctionGotError string = "err-500-sgfge" ErrCodeServerDatabaseCreateGotError string = "err-500-sdbcge" ErrCodeServerDatabaseQueryGotError string = "err-500-sdbqge" ErrCodeServerDatabaseUpdateGotError string = "err-500-sdbuge" ErrCodeServerDatabaseDeleteGotError string = "err-500-sdbdge" ErrCodeServerRedisSetNXKeyGotError string = "err-500-srsnxkge" ErrCodeServerRedisSetKeyGotError string = "err-500-srskge" ErrCodeServerRedisGetKeyGotError string = "err-500-srgkge" ErrCodeServerRedisDeleteKeyGotError string = "err-500-srdkge" ErrCodeServerSendEmailGotError string = "err-500-ssege" ErrCodeServerGenerateJWTTokenGotError string = "err-500-sgjwttge" )
All common error codes
Variables ¶
This section is empty.
Functions ¶
func GetFilteredNilRequestPayloadMap ¶
func GetFilteredNilRequestPayloadMap(any interface{}) map[string]interface{}
Types ¶
type GormModelResponse ¶
type JSONResponse ¶
type JSONResponse struct { Code string `json:"code"` Message interface{} `json:"message"` Data interface{} `json:"data"` }
func InitAccountDataWhenSignUp ¶
func InitAccountDataWhenSignUp(accountModel *models.Account) (errResponse JSONResponse, hasErr bool)
Click to show internal directories.
Click to hide internal directories.