Documentation ¶
Index ¶
- func HashPassword(password, salt string) string
- func NewCreateUserHandler(u UserStorage, tm UserTokenManager) http.HandlerFunc
- func NewLoginHandler(u UserStorage, tm UserTokenManager) http.HandlerFunc
- func NewRefreshHandler(tm UserTokenManager) http.HandlerFunc
- func NewSalt(size int) string
- func NewToken(secret []byte, body []byte) string
- func VerifyToken(secret []byte, token string) ([]byte, error)
- type Password
- type User
- type UserStorage
- type UserToken
- type UserTokenManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
func NewCreateUserHandler ¶
func NewCreateUserHandler(u UserStorage, tm UserTokenManager) http.HandlerFunc
NewCreateUserHandler creates a new user. the required token is generally a system token, or an admin token.
func NewLoginHandler ¶
func NewLoginHandler(u UserStorage, tm UserTokenManager) http.HandlerFunc
func NewRefreshHandler ¶
func NewRefreshHandler(tm UserTokenManager) http.HandlerFunc
NewRefreshHandler generates a new token, using an existing token.
Types ¶
type Password ¶
func NewPassword ¶
type User ¶
func (*User) SetPassword ¶
type UserStorage ¶
type UserTokenManager ¶
func NewUserTokenManager ¶
func NewUserTokenManager(secret []byte) UserTokenManager
Click to show internal directories.
Click to hide internal directories.