Documentation ¶
Index ¶
- type UserManager
- func (um *UserManager) AddUserClient(id string, client string) error
- func (um *UserManager) CheckUserExists(id string) bool
- func (um *UserManager) CheckUserPW(id string, pw string) (bool, error)
- func (um *UserManager) CreateUser(name string, mail string) (string, error)
- func (um *UserManager) DeleteUserClient(id string, client string) error
- func (um *UserManager) GetUserAdmin(id string) (bool, error)
- func (um *UserManager) GetUserByID(id string) (*user.User, error)
- func (um *UserManager) GetUserClients(id string) (*[]string, error)
- func (um *UserManager) GetUserIDByMail(mail string) (string, error)
- func (um *UserManager) SetUserAdmin(id string, admin bool) error
- func (um *UserManager) SetUserMail(id string, mail string) error
- func (um *UserManager) SetUserName(id string, name string) error
- func (um *UserManager) SetUserPW(id string, pw string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserManager ¶
type UserManager struct { Userconfig *user.Users WAClients *waclient.WAClients // contains filtered or unexported fields }
UserManager represents all users and clients
func NewUserManager ¶
func NewUserManager(c config.Data) *UserManager
NewUserManager returns new User
func (*UserManager) AddUserClient ¶
func (um *UserManager) AddUserClient(id string, client string) error
AddUserClient adds client id for given user id
func (*UserManager) CheckUserExists ¶
func (um *UserManager) CheckUserExists(id string) bool
CheckUserExists checks if user exists for given user id
func (*UserManager) CheckUserPW ¶
func (um *UserManager) CheckUserPW(id string, pw string) (bool, error)
CheckUserPW checks password for givebn user id
func (*UserManager) CreateUser ¶
func (um *UserManager) CreateUser(name string, mail string) (string, error)
CreateUser creates a new user and returns its id
func (*UserManager) DeleteUserClient ¶
func (um *UserManager) DeleteUserClient(id string, client string) error
DeleteUserClient removes client id for given user id
func (*UserManager) GetUserAdmin ¶
func (um *UserManager) GetUserAdmin(id string) (bool, error)
GetUserAdmin returns admin status for given user id
func (*UserManager) GetUserByID ¶
func (um *UserManager) GetUserByID(id string) (*user.User, error)
GetUserByID returns User struct for given user id
func (*UserManager) GetUserClients ¶
func (um *UserManager) GetUserClients(id string) (*[]string, error)
GetUserClients returns all client ids for given user id
func (*UserManager) GetUserIDByMail ¶
func (um *UserManager) GetUserIDByMail(mail string) (string, error)
GetUserIDByMail returns user id for given mail address
func (*UserManager) SetUserAdmin ¶
func (um *UserManager) SetUserAdmin(id string, admin bool) error
SetUserAdmin sets admin status for given user id
func (*UserManager) SetUserMail ¶
func (um *UserManager) SetUserMail(id string, mail string) error
SetUserMail sets user mail address for given user id
func (*UserManager) SetUserName ¶
func (um *UserManager) SetUserName(id string, name string) error
SetUserName sets name for given user id