Documentation
¶
Index ¶
Constants ¶
View Source
const ( ViperJWTTTLKey = "service.jwt_ttl" ViperJWTSecretKey = "service.jwt_secret" )
View Source
const (
Nothing = ""
)
Variables ¶
View Source
var ( // Unathorized ErrMissingAuthToken = &CodedError{errors.New("missing authorization token"), http.StatusUnauthorized} ErrMissingAuthCookie = &CodedError{errors.New("missing authorization cookie"), http.StatusUnauthorized} ErrPasswordMismatch = &CodedError{errors.New("password mismatch"), http.StatusUnauthorized} ErrAuthTokenInvalid = &CodedError{errors.New("authorization token is invalid"), http.StatusUnauthorized} ErrUnexpectedSigningMethod = &CodedError{errors.New("unexpected signing method"), http.StatusUnauthorized} // Forbidden ErrAuthTokenExpired = &CodedError{errors.New("authorization token is expired"), http.StatusForbidden} ErrAuthorIDMismatch = &CodedError{errors.New("author id mismatch"), http.StatusForbidden} // Bad Request ErrValidateRequest = &CodedError{errors.New("failed to validate request"), http.StatusBadRequest} ErrDBNotFound = &CodedError{errors.New("not found in the database"), http.StatusBadRequest} ErrPassword = &CodedError{errors.New("error generating hash"), http.StatusBadRequest} ErrPasswordSalt = &CodedError{errors.New("error generating salt"), http.StatusBadRequest} // Internal ErrSignToken = &CodedError{errors.New("failed to sign token"), http.StatusInternalServerError} ErrGenerateUUID = &CodedError{errors.New("failed to generate UUID"), http.StatusInternalServerError} ErrParseAuthToken = &CodedError{errors.New("failed to parse authorization token"), http.StatusInternalServerError} // Conflict ErrEmailAlreadyTaken = &CodedError{errors.New("email is taken already by other user"), http.StatusConflict} )
Functions ¶
This section is empty.
Types ¶
type CodedError ¶
type CodedError struct {
// contains filtered or unexported fields
}
CodedError is an error wrapper which wraps errors with http status codes.
func (*CodedError) Code ¶
func (ce *CodedError) Code() int
func (*CodedError) Error ¶
func (ce *CodedError) Error() string
Click to show internal directories.
Click to hide internal directories.