Documentation ¶
Index ¶
- Constants
- Variables
- func CannotReadRequestBody(w http.ResponseWriter)
- func HandleError(w http.ResponseWriter, err error)
- func InvalidParam(w http.ResponseWriter)
- func InvalidRequestBody(w http.ResponseWriter)
- func InvalidToken(w http.ResponseWriter)
- func JSON(w http.ResponseWriter, obj interface{})
- func MissingEmail(w http.ResponseWriter)
- func MissingFields(fields interface{}) string
- func MissingPermissionLevel(w http.ResponseWriter)
- func MissingReqFields(w http.ResponseWriter, vars map[string]string)
- func MissingToken(w http.ResponseWriter)
- func MissingUserInfo(w http.ResponseWriter)
- func NotFound(w http.ResponseWriter)
- func Success(w http.ResponseWriter)
- func UnknownError(w http.ResponseWriter)
- type RegistrarResponse
Constants ¶
View Source
const AlreadyExists = "entity already exists"
generic error response messages
View Source
const ErrCannotReadRequestBody = "could not read request body"
View Source
const ErrInvalidParam = "query parameter is invalid"
View Source
const ErrInvalidRequestBody = "invalid request body"
View Source
const MissingEmailMsg = "email must be provided"
View Source
const MissingPermissionLevelMsg = "permission_level must be provided"
View Source
const NotFoundMsg = "not found"
View Source
const SomethingWentWrong = "something went wrong"
View Source
const SuccessMsg = "success"
generic success messages
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrMissingToken = errors.New("missing token") )
Functions ¶
func CannotReadRequestBody ¶
func CannotReadRequestBody(w http.ResponseWriter)
func HandleError ¶
func HandleError(w http.ResponseWriter, err error)
func InvalidParam ¶
func InvalidParam(w http.ResponseWriter)
func InvalidRequestBody ¶
func InvalidRequestBody(w http.ResponseWriter)
func InvalidToken ¶
func InvalidToken(w http.ResponseWriter)
func JSON ¶
func JSON(w http.ResponseWriter, obj interface{})
func MissingEmail ¶
func MissingEmail(w http.ResponseWriter)
func MissingFields ¶
func MissingFields(fields interface{}) string
func MissingPermissionLevel ¶
func MissingPermissionLevel(w http.ResponseWriter)
func MissingReqFields ¶
func MissingReqFields(w http.ResponseWriter, vars map[string]string)
func MissingToken ¶
func MissingToken(w http.ResponseWriter)
func MissingUserInfo ¶
func MissingUserInfo(w http.ResponseWriter)
func NotFound ¶
func NotFound(w http.ResponseWriter)
func Success ¶
func Success(w http.ResponseWriter)
func UnknownError ¶
func UnknownError(w http.ResponseWriter)
Types ¶
type RegistrarResponse ¶
type RegistrarResponse struct {
Message string `json:"message"`
}
Click to show internal directories.
Click to hide internal directories.