Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIErrorCodeMapping = map[APIErrorCode]int{ APIErrorNotFound: http.StatusNotFound, APIErrorUnauthenticated: http.StatusUnauthorized, APIErrorUntrustedService: http.StatusForbidden, APIErrorUnimplemented: http.StatusNotImplemented, APIErrorInvalidParameter: http.StatusBadRequest, APIErrorProviderError: http.StatusBadGateway, APIErrorServerError: http.StatusInternalServerError, }
APIErrorCodeMapping stores the HTTP error code mapping for various APIErrorCodes
Functions ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, r *http.Request, code APIErrorCode, message string, e error)
WriteError handles writing error responses
Types ¶
type APIError ¶
type APIError struct { Code APIErrorCode `json:"code"` Message string `json:"message"` }
APIError encompasses the error type and message
type APIErrorCode ¶
type APIErrorCode string
APIErrorCode stores the type of error encountered
const ( APIErrorNotFound APIErrorCode = "RESOURCE_NOT_FOUND" APIErrorUnauthenticated APIErrorCode = "UNAUTHENTICATED" APIErrorUntrustedService APIErrorCode = "UNTRUSTED_SERVICE" APIErrorUnimplemented APIErrorCode = "FUNCTION_NOT_IMPLEMENTED" APIErrorInvalidParameter APIErrorCode = "INVALID_PARAMETER" APIErrorProviderError APIErrorCode = "PROVIDER_ERROR" APIErrorServerError APIErrorCode = "SERVER_ERROR" )
The various types of errors that can be expected to occur
type Config ¶
type Config struct { SMTPCredentials *smtpclient.SMTPCredentials `mapstructure:"smtp_credentials"` Prefix string `mapstructure:"prefix"` Host string `mapstructure:"host"` GatewaySvc string `mapstructure:"gatewaysvc"` MeshDirectoryURL string `mapstructure:"mesh_directory_url"` Config configData `mapstructure:"config"` }
Config holds the config options that need to be passed down to all ocdav handlers
Click to show internal directories.
Click to hide internal directories.