Documentation ¶
Index ¶
- type APIError
- func AppAlreadyKnown(app string) APIError
- func AppIsNotKnown(app string) APIError
- func BadRequest(err error, details ...string) APIError
- func ConfigurationAlreadyBound(configuration string) APIError
- func ConfigurationAlreadyKnown(configuration string) APIError
- func ConfigurationIsNotBound(configuration string) APIError
- func ConfigurationIsNotKnown(configuration string) APIError
- func InternalError(err error, details ...string) APIError
- func NamespaceAlreadyKnown(namespace string) APIError
- func NamespaceIsNotKnown(namespace string) APIError
- func NewAPIError(title string, details string, status int) APIError
- func NewBadRequest(msg string, details ...string) APIError
- func NewInternalError(msg string, details ...string) APIError
- func NewNotFoundError(msg string, details ...string) APIError
- func ServiceIsNotKnown(service string) APIError
- func UserNotFound() APIError
- type APIErrors
- type ErrorResponse
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Status int `json:"status"` Title string `json:"title"` Details string `json:"details"` }
APIError fulfills the error and APIErrors interfaces. It contains a single error.
func AppAlreadyKnown ¶
AppAlreadyKnown constructs an API error for when we have a conflict with an existing app
func AppIsNotKnown ¶
AppIsNotKnown constructs an API error for when the desired app does not exist
func BadRequest ¶
BadRequest constructs an API error for general issues with a request, from a lower-level error
func ConfigurationAlreadyBound ¶ added in v0.6.0
ConfigurationAlreadyBound constructs an API error for when the configuration to bind is already bound to the app
func ConfigurationAlreadyKnown ¶ added in v0.6.0
ConfigurationAlreadyKnown constructs an API error for when we have a conflict with an existing configuration instance
func ConfigurationIsNotBound ¶ added in v0.6.0
ConfigurationIsNotBound constructs an API error for when the configuration to unbind is actually not bound to the app
func ConfigurationIsNotKnown ¶ added in v0.6.0
ConfigurationIsNotKnown constructs an API error for when the desired configuration instance does not exist
func InternalError ¶
InternalError constructs an API error for server internal issues, from a lower-level error
func NamespaceAlreadyKnown ¶ added in v0.2.1
NamespaceAlreadyKnown constructs an API error for when we have a conflict with an existing namespace
func NamespaceIsNotKnown ¶ added in v0.2.1
NamespaceIsNotKnown constructs an API error for when the desired namespace does not exist
func NewAPIError ¶
NewAPIError constructs an APIerror from basics
func NewBadRequest ¶
NewBadRequest constructs an API error for general issues with a request, from a message
func NewInternalError ¶
NewInternalError constructs an API error for server internal issues, from a message
func NewNotFoundError ¶
NewNotFoundError constructs a general API error for when something desired does not exist
func ServiceIsNotKnown ¶
ServiceIsNotKnown constructs an API error for when the desired service does not exist
func UserNotFound ¶
func UserNotFound() APIError
UserNotFound constructs an API error for when the user name is not found in the header
func (APIError) FirstStatus ¶
FirstStatus (APIErrors interface) returns the stored error's status
type ErrorResponse ¶
type ErrorResponse struct {
Errors []APIError `json:"errors"`
}
ErrorResponse is the response's JSON, that is send in case of an error
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
MultiError fulfills the APIErrors interface. It contains multiple errors.
func NewMultiError ¶
func NewMultiError(errs []APIError) MultiError
NewMultiError constructs an APIerror from basics
func (MultiError) Errors ¶
func (m MultiError) Errors() []APIError
Errors satisfies the APIErrors interface
func (MultiError) FirstStatus ¶
func (m MultiError) FirstStatus() int
FirstStatus (APIErrors interface) returns the status of the first error stored