Documentation ¶
Index ¶
- Variables
- func DaltonLogin(username string, password string) (map[string]interface{}, string, string, http.CookieJar, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func GenerateUID() (string, error)
- func SetSession(name string, value SessionInfo)
- type SessionInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
View Source
var RedisClient *redis.Client
Functions ¶
func DaltonLogin ¶
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.
func GenerateUID ¶
GenerateUID creates a random session ID, for use with the session store.
func SetSession ¶
func SetSession(name string, value SessionInfo)
SetSession stores the given value under the given name in the database. If the given name is already used, its value is overwritten.
Types ¶
type SessionInfo ¶
type SessionInfo struct {
UserID int
}
func GetSession ¶
func GetSession(name string) SessionInfo
GetSession retrieves the session information for the given name
func GetSessionFromAuthToken ¶
func GetSessionFromAuthToken(authToken string) SessionInfo
Click to show internal directories.
Click to hide internal directories.