Documentation ¶
Index ¶
- func CreateEmptyUserDB(fName string) error
- type User
- type UserDB
- func (udb UserDB) Authorized(userName, password string) (bool, error)
- func (udb UserDB) DeleteUser(userName string) error
- func (udb UserDB) GetPasswordHash(userName string) (string, error)
- func (udb UserDB) GetUserByName(name string) (User, error)
- func (udb UserDB) GetUsers() ([]User, error)
- func (udb UserDB) InsertUser(u User, password string) error
- func (udb UserDB) Update(user User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyUserDB ¶
CreateEmptyUserDB is used to create an empty user database
Types ¶
type User ¶
type User struct { ID int64 `json:"id"` Name string `json:"name"` //PasswordHash string `json:"password_hash"` // TODO Should not be part of User? Roles string `json:"roles"` DBs string `json:"dbs"` }
A User class for the user db
type UserDB ¶
UserDB : A user database
func InitUserDB ¶
InitUserDB is used to setup the initial user database
func (UserDB) Authorized ¶
Authorized is used to check if the password matches the specified user name
func (UserDB) DeleteUser ¶
DeleteUser is used to delete a user from the database
func (UserDB) GetPasswordHash ¶
GetPasswordHash returns the password_hash value for userName. If no such value is found, the empty string is returned (along with a non-nil error value)
func (UserDB) GetUserByName ¶
GetUserByName looks up the user with the specified name
func (UserDB) InsertUser ¶
InsertUser is used to insert a user into the database
Click to show internal directories.
Click to hide internal directories.