Documentation ¶
Index ¶
- func RandomBytes(length int) (key []byte, err error)
- func RandomString(length int) (key string, err error)
- type Auth
- func (auth *Auth) Authorize(username string, password string) (tokenString string, err error)
- func (auth *Auth) GenerateTokenString(userID string) (tokenString string, err error)
- func (auth *Auth) NewAuthorization(userID string) (sessionID string, err error)
- func (auth *Auth) ValidateSessionID(sessionID string) string
- func (auth *Auth) ValidateToken(tokenString string) (sessionId string, err error)
- type AuthData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomBytes ¶
RandomBytes is useful to generate HMAC key
func RandomString ¶
RandomBytes is useful to generate HMAC key
Types ¶
type Auth ¶
func (*Auth) Authorize ¶
Authorize checks username and password and generates a token with the session id
func (*Auth) GenerateTokenString ¶
GenerateTokenString generates New JWT Token String
func (*Auth) NewAuthorization ¶
NewAuthorization generates a new sessionID
func (*Auth) ValidateSessionID ¶
ValidateSessionID validates the sessionID
Click to show internal directories.
Click to hide internal directories.