Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPasswordTooShort = errors.New("passwords must be at least 8 bytes long")
View Source
var ErrUsernameTooShort = errors.New("usernames must be at least 1 byte long")
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
Credentials holds a user's hashed password and salt.
func NewCredentials ¶
func NewCredentials(username string, password string) (Credentials, error)
NewCredentials creates a new user with a salt and hashed password
func (Credentials) Authenticate ¶
func (c Credentials) Authenticate(password string) (bool, error)
Authenticate checks if the password is correct.
Click to show internal directories.
Click to hide internal directories.