Documentation
¶
Index ¶
Constants ¶
View Source
const ( InstApp = "app" InstApi = "api" InstIdentity = "identity" InstClient = "client" InstDB = "database" )
Types of instances
View Source
const ( BadRequest = "Bad request!" CharterHasListings = "Charter cannot be deleted!" CharterNotCreated = "Charter not created!" InvalidMsgFormat = "Invalid message format!" InvalidBodyParam = "Invalid body parameter!" InvalidHeaderParam = "Invalid header parameter!" InvalidQueryParam = "Invalid query parameter!" InvalidPathParam = "Invalid path parameter!" ListingNotCreated = "Listing not created!" LocationNotCreated = "Location not created!" MandatoryParamIncorrect = "Mandatory parameter incorrect!" MandatoryParamMissing = "Mandatory parameter missing!" NameAlreadyTaken = "Name is already taken!" PortAlreadyExists = "Port name exists already!" ReservationNotCreated = "Reservation not created!" )
List of 400 errors
View Source
const ( InvalidAuthToken = "Invalid authorization token!" MissingAuthToken = "Missing authorization token!" )
List of 401 errors
View Source
const ( ForbiddenAction = "Forbidden action!" ForbiddenResource = "Forbidden resource!" )
List of 403 errors
View Source
const ( CharterNotFound = "Charter not found!" ListingNotFound = "Listing not found!" LocationNotFound = "Location not found!" ResourceNotFound = "Resource not found!" UserNotFound = "User not found!" UsersNotFound = "Users not found!" )
list of 404 errors
View Source
const ( SystemFailure = "System failure!" UnspecifiedFailure = "Unspecified failure!" )
List of 500 errors
View Source
const (
MethodNotAllowed = "Method not allowed!"
)
list of 405 errors
Variables ¶
This section is empty.
Functions ¶
func CreateProblemDetails ¶
func CreateProblemDetails(errorName string) *models.ProblemDetails
CreateProblemDetails - Helper function to create ProblemDetails object
func NewInvalidParam ¶
func NewInvalidParam(name string) *models.InvalidParam
func NewMissingParam ¶
func NewMissingParam(name string) *models.InvalidParam
func ServeError ¶
func ServeError(rw http.ResponseWriter, r *http.Request, err error)
ServeError the error handler interface implementation
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.