Documentation
¶
Index ¶
Constants ¶
View Source
const ( OK ResponseCode = "RC-001" CUT_OFF ResponseCode = "RC-002" FAILED_TO_PROCEED ResponseCode = "RC-003" BAD_REQUEST ResponseCode = "RC-004" UNPROCESSABLE_ENTITY ResponseCode = "RC-005" TIMEOUT ResponseCode = "RC-006" CLIENT_TIMEOUT ResponseCode = "RC-007" FAILED_TO_ESTABLISHED_CONNECTION_TO_CLIENT ResponseCode = "RC-008" INTERNAL_SERVER_ERROR ResponseCode = "RC-009" NOT_FOUND ResponseCode = "RC-010" UNAUTHORIZED ResponseCode = "RC-011" CONFLICT ResponseCode = "RC-012" FORBIDDEN ResponseCode = "RC-013" HTTP_GET HTTPMethod = "GET" HTTP_POST HTTPMethod = "POST" HTTP_PUT HTTPMethod = "PUT" HTTP_PATCH HTTPMethod = "PATCH" HTTP_DELETE HTTPMethod = "DELETE" LOCAL EnvironmentType = "local" DEVELOPMENT EnvironmentType = "development" PRODUCTION EnvironmentType = "production" ENVIRONMENT_KEY string = "env" EVENT_IDEMPOTENT_ID = "idempotent_id" AccessToken HTTPHeader = "access-token" Bearer HTTPHeader = "bearer" Basic HTTPHeader = "basic" CSRFToken HTTPHeader = "csrf-token" Authorization HTTPHeader = "authorization" SessionToken HTTPHeader = "session-token" CLIENT_REQUEST_LOG_CREATED_EVENT Event = "client_request_log_created_event" InternalServerErrorResponseMessage ResponseMessage = "we truly apologize for the issue, please help us by contacting our customer service, we will work on it ASAP" ConflictResponseMessage ResponseMessage = "the requested action cannot be completed due to conflicting information" NotFoundResponseMessage ResponseMessage = "the data that you are looking for is not found" BadRequestResponseMessage ResponseMessage = "the mandatory data you provided is not complete or incorrect format" UnprocessableEntityResponseMessage ResponseMessage = "the data you provide cannot be process for this moment, please try again later or contact our customer support" OKResponseMessage ResponseMessage = "ok" AcceptedResponseMessage ResponseMessage = "accepted" NoContentResponseMessage ResponseMessage = "no content" NotAcceptableResponseMessage ResponseMessage = "not acceptable data provided" ForbiddenResponseMessage ResponseMessage = "forbidden" )
Variables ¶
View Source
var ( HTTPStatusToResponseCodeMappping = map[int]ResponseCode{ http.StatusBadRequest: BAD_REQUEST, http.StatusUnauthorized: UNAUTHORIZED, http.StatusForbidden: FORBIDDEN, http.StatusNotFound: NOT_FOUND, http.StatusConflict: CONFLICT, http.StatusUnprocessableEntity: UNPROCESSABLE_ENTITY, http.StatusInternalServerError: INTERNAL_SERVER_ERROR, http.StatusOK: OK, http.StatusAccepted: OK, http.StatusNoContent: OK, http.StatusNotAcceptable: UNPROCESSABLE_ENTITY, } HTTPStatusToResponseMessage = map[int]ResponseMessage{ http.StatusBadRequest: BadRequestResponseMessage, http.StatusUnauthorized: UnauthorizedResponseMessage, http.StatusForbidden: ForbiddenResponseMessage, http.StatusNotFound: NotFoundResponseMessage, http.StatusConflict: ConflictResponseMessage, http.StatusUnprocessableEntity: UnprocessableEntityResponseMessage, http.StatusInternalServerError: InternalServerErrorResponseMessage, http.StatusOK: OKResponseMessage, http.StatusAccepted: AcceptedResponseMessage, http.StatusNoContent: NoContentResponseMessage, } ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type EnvironmentType ¶
type EnvironmentType string
type HTTPHeader ¶
type HTTPHeader string
type HTTPMethod ¶
type HTTPMethod string
type ResponseCode ¶
type ResponseCode string
type ResponseMessage ¶
type ResponseMessage string
Click to show internal directories.
Click to hide internal directories.