Versions in this module Expand all Collapse all v1 v1.0.0 Jun 8, 2024 Changes in this version + const StatusAccepted + const StatusCodeAlreadyRegistered + const StatusCodeBadRequest + const StatusCodeConflict + const StatusCodeFailedOTP + const StatusCodeFailedSellBatch + const StatusCodeForbidden + const StatusCodeGenericPreconditionFailed + const StatusCodeGenericSuccess + const StatusCodeInternalError + const StatusCodeNoLinkerExist + const StatusCodeNotFound + const StatusCodeOTPLimitReached + const StatusCodeServiceUnavailable + const StatusCodeTimeoutError + const StatusCodeUnauthorized + const StatusCreated + const StatusCtxKey + const StatusErrorForm + const StatusErrorUnknown + const StatusForbidden + const StatusInternalError + const StatusInvalidAuthentication + const StatusNotFound + const StatusSuccess + const StatusUnauthorized + var ErrBadRequest = errors.New("bad request") + var ErrConflict = errors.New("conflict") + var ErrForbiddenResource = errors.New("forbidden resource") + var ErrInternalServerError = errors.New("internal server error") + var ErrNotFound = errors.New("not found") + var ErrPreConditionFailed = errors.New("precondition failed") + var ErrTimeoutError = errors.New("timeout error") + var ErrUnauthorized = errors.New("unauthorized") + func GetErrorCode(err error) string + func GetHTTPCode(code string) int + func StatusCode(code int) string + func StatusText(code int) string + type JSONResponse struct + Code string + Data interface{} + Error error + ErrorString string + HTMLPage bool + Latency string + Log map[string]interface{} + Message string + RealError string + Result interface{} + StatusCode int + func NewJSONResponse() *JSONResponse + func (r *JSONResponse) APIStatusAccepted() *JSONResponse + func (r *JSONResponse) APIStatusBadRequest() *JSONResponse + func (r *JSONResponse) APIStatusCreated() *JSONResponse + func (r *JSONResponse) APIStatusErrorUnknown() *JSONResponse + func (r *JSONResponse) APIStatusForbidden() *JSONResponse + func (r *JSONResponse) APIStatusInvalidAuthentication() *JSONResponse + func (r *JSONResponse) APIStatusNotFound() *JSONResponse + func (r *JSONResponse) APIStatusSuccess() *JSONResponse + func (r *JSONResponse) APIStatusUnauthorized() *JSONResponse + func (r *JSONResponse) GetBody() []byte + func (r *JSONResponse) Send(w http.ResponseWriter) + func (r *JSONResponse) SetData(data interface{}) *JSONResponse + func (r *JSONResponse) SetError(err error, a ...string) *JSONResponse + func (r *JSONResponse) SetHTML() *JSONResponse + func (r *JSONResponse) SetLatency(latency float64) *JSONResponse + func (r *JSONResponse) SetLog(key string, val interface{}) *JSONResponse + func (r *JSONResponse) SetMessage(msg string) *JSONResponse + func (r *JSONResponse) SetResult(result interface{}) *JSONResponse