Documentation ¶
Index ¶
- func AddURL(owner int, src string, dst string, isCustom bool) error
- func ChangePassword(id_user int, password string) error
- func Close()
- func Connect() *sql.DB
- func CreateUser(username string, password string) error
- func DeleteURL(id_link int) error
- func GetCurrentUsername(r *http.Request) (string, error)
- func GetKeyFromRequest(r *http.Request) (string, error)
- func GetURLRedirect(src string) (string, error)
- func GetUserDetails(username string) (int, string, string, error)
- func GetUserIDFromSessionID(sessionid string) (int, error)
- func HashPassword(password, salt string) string
- func InvalidateAllSessionIDs(id_user int) error
- func InvalidateSessionID(sessionid string) error
- func IsAPIKeyValid(sessionid string) bool
- func IsSessionIDValid(sessionid string) bool
- func NewSessionID(id_user int, valid_until int, api bool) (string, error)
- func RandString(n int) string
- func UpdateURL(id_link int, src string, dst string, isCustom bool) error
- func ValidatePassword(password, salt, hashedPwd string) bool
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePassword ¶
func CreateUser ¶
func GetCurrentUsername ¶
Get the username from the session ID
func GetURLRedirect ¶
func GetUserIDFromSessionID ¶
Get the user ID from the session ID
func HashPassword ¶
func InvalidateAllSessionIDs ¶
func InvalidateSessionID ¶
func IsAPIKeyValid ¶
The session ID exists, is valid, and is an API key
func IsSessionIDValid ¶
The session ID exists, is valid, and is not an API key
func RandString ¶
func ValidatePassword ¶
Validate the user's credentials
Types ¶
Click to show internal directories.
Click to hide internal directories.