Documentation ¶
Index ¶
- Constants
- func CreateProblemDetails(errorName string) *models.ProblemDetails
- func NewImageSizeError(size int64) *models.InvalidParam
- func NewImageSizePxError(name string, px int) *models.InvalidParam
- func NewInvalidParam(name string) *models.InvalidParam
- func NewMissingParam(name string) *models.InvalidParam
- func ServeError(rw http.ResponseWriter, r *http.Request, err error)
Constants ¶
View Source
const ( InstApp = "app" InstExport = "export" InstImage = "image" InstApi = "api" InstIdentity = "identity" InstClient = "client" InstDB = "database" )
Types of instances
View Source
const ( AlreadyExists = "Already exists!" OffersEnded = "Offers ended today!" OffersMaxListings = "Maximum listings reached!" ImageInvalid = "File is not a valid image!" ImageNotDeleted = "Image cannot be deleted!" ImageNotUploaded = "Image cannot be uploaded!" BadRequest = "Bad request!" CharterHasListings = "Charter cannot be deleted!" CharterNotCreated = "Charter not created!" FileExistsAlready = "File exists already!" FileNotCreated = "File not created!" InactiveListing = "Inactive Listing!" InvalidMsgFormat = "Invalid message format!" InvalidBodyParam = "Invalid body parameter!" InvalidDates = "Invalid dates!" InvalidHeaderParam = "Invalid header parameter!" InvalidOwnerListing = "Invalid owner listing!" 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!" ForbiddenUpload = "Forbidden upload!" )
List of 403 errors
View Source
const ( CharterNotFound = "Charter not found!" ListingNotFound = "Listing not found!" LocationNotFound = "Location not found!" ReservationNotFound = "Reservation 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 (
CongestionRisk = "Too many requests!"
)
list of 429 errors
View Source
const (
GatewayTimeout = "Gateway Timeout!"
)
List of 504 errors
View Source
const (
MethodNotAllowed = "Method not allowed!"
)
list of 405 errors
View Source
const (
)List of 503 errors
Variables ¶
This section is empty.
Functions ¶
func CreateProblemDetails ¶
func CreateProblemDetails(errorName string) *models.ProblemDetails
CreateProblemDetails - Helper function to create ProblemDetails object
func NewImageSizeError ¶ added in v1.0.5
func NewImageSizeError(size int64) *models.InvalidParam
func NewImageSizePxError ¶ added in v1.0.5
func NewImageSizePxError(name string, px int) *models.InvalidParam
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.