Documentation ¶
Index ¶
Constants ¶
View Source
const ( UserRoleAdmin = "admin" UserRoleCustomer = "customer" )
Variables ¶
View Source
var InternalCodeMap = map[int]InternalCode{ http.StatusInternalServerError: DefaultUnhandledError, http.StatusNotFound: DefaultNotFoundError, http.StatusBadRequest: DefaultBadRequestError, http.StatusUnauthorized: DefaultUnauthorizedError, http.StatusConflict: DefaultDuplicateDataError, }
Functions ¶
func HTTPStatusText ¶
Types ¶
type ContextKey ¶
type ContextKey string
const ( UserIDKey ContextKey = "user_id" RoleKey ContextKey = "role" )
type InternalCode ¶
type InternalCode int
const ( DefaultUnhandledError InternalCode = 1000 + iota DefaultNotFoundError DefaultMethodNotAllowedError DefaultBadRequestError DefaultDuplicateDataError )
Click to show internal directories.
Click to hide internal directories.