usermanager

package
v0.0.0-...-1599866 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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

func (*UserManager) SetUserPW

func (um *UserManager) SetUserPW(id string, pw string) error

SetUserPW sets password for given user id

Jump to

Keyboard shortcuts

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