Documentation ¶ Index ¶ func ServeError(log *zap.Logger, w http.ResponseWriter, status int, err error) type Auth type HTTPError func (e HTTPError) Error() string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ServeError ¶ func ServeError(log *zap.Logger, w http.ResponseWriter, status int, err error) ServeError writes JSON error to response output stream. Types ¶ type Auth ¶ type Auth interface { // IsAuthenticated checks if request is performed with all needed authorization credentials. IsAuthenticated(r *http.Request) error } Auth exposes methods to control authentication process for each endpoint. type HTTPError ¶ type HTTPError struct { Status int Err error } HTTPError holds http error entity with http status and error itself. func (HTTPError) Error ¶ func (e HTTPError) Error() string Error returns http error's string representation. Source Files ¶ View all Source files authentication.go errorhandling.go Click to show internal directories. Click to hide internal directories.