Documentation and started tests for auth package.
This commit is contained in:
parent
ed9413ee17
commit
774f0b0858
5 changed files with 175 additions and 25 deletions
17
auth/errors.go
Normal file
17
auth/errors.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package auth
|
||||
|
||||
// NotAuthenticatedError is an error returned when a user is not authenticated
|
||||
type NotAuthenticatedError struct{}
|
||||
|
||||
// Error implements the error interface.
|
||||
func (e NotAuthenticatedError) Error() string {
|
||||
return "user not authenticated"
|
||||
}
|
||||
|
||||
// InvalidTokenError is an error returned when an invalid token is provided
|
||||
type InvalidTokenError struct{}
|
||||
|
||||
// Error implements the error interface.
|
||||
func (e InvalidTokenError) Error() string {
|
||||
return "invalid token"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue