responses

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL