user

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountUser

func CountUser(db *sql.DB) (int64, error)

CountUser Count user table

func DeleteUserWithDependencies

func DeleteUserWithDependencies(db database.Executer, u *sdk.User) error

DeleteUserWithDependencies Delete user and all his dependencies

func DeleteUserWithDependenciesByName added in v0.4.0

func DeleteUserWithDependenciesByName(db database.QueryExecuter, s string) error

DeleteUserWithDependenciesByName Delete user and all his dependencies

func FindUserIDByName

func FindUserIDByName(db *sql.DB, name string) (int64, error)

FindUserIDByName retrieves only user ID in database

func GeneratePassword

func GeneratePassword() (string, string, error)

GeneratePassword Generate a password/token for the user

func InsertUser

func InsertUser(db database.QueryExecuter, u *sdk.User, a *sdk.Auth) error

InsertUser Insert new user

func IsCheckValid

func IsCheckValid(clear, hashField string) bool

IsCheckValid return false if hashedVersion of clar is not equals to hash. Hash contains $sha512$salt$passwordHashed$

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail Check if user email address is ok

func LoadGroupPermissions

func LoadGroupPermissions(db *sql.DB, groupID int64) (*sdk.Group, error)

LoadGroupPermissions retrieves all group memberships

func LoadUserAndAuth

func LoadUserAndAuth(db *sql.DB, name string) (*sdk.User, error)

LoadUserAndAuth Load user with auth information

func LoadUserPermissions

func LoadUserPermissions(db *sql.DB, user *sdk.User) error

LoadUserPermissions retrieves all group memberships

func LoadUserWithoutAuth

func LoadUserWithoutAuth(db database.Querier, name string) (*sdk.User, error)

LoadUserWithoutAuth load user without auth information

func LoadUserWithoutAuthByID

func LoadUserWithoutAuthByID(db *sql.DB, userID int64) (*sdk.User, error)

LoadUserWithoutAuthByID load user information without secret

func LoadUsers

func LoadUsers(db *sql.DB) ([]*sdk.User, error)

LoadUsers load all users from database

func UpdateUser

func UpdateUser(db *sql.DB, u sdk.User) error

UpdateUser update given user

func UpdateUserAndAuth

func UpdateUserAndAuth(db *sql.DB, u sdk.User) error

UpdateUserAndAuth update given user

func Verify

func Verify(u *sdk.User, token string) (string, string, error)

Verify verify user token

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL