user

package
v0.0.0-...-9b4e82f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserList = make(map[string]*User)

keep the uuid to user

View Source
var UserListLock = lock.NewLock("user-list")

Functions

func NewUser

func NewUser(username, displayName, password string) (string, error)

* Build a new user set their Password to that provided

func ValidateUser

func ValidateUser(username, password string) (string, error)

* Return a user provided the username and Password If the Password is correct return user, else return err

Types

type User

type User struct {
	objects.User
	Lock           *lock.Lock                    `json:"-"`
	UserUpdateChan *duplicator.ChannelDuplicator `json:"-"`
	Sender         *sender.Sender                `json:"-"`
}

User Object Represents a unique individual of the system

func ConnectUser

func ConnectUser(sessionToken string) (*User, error)

* Renew a user user a session token

func GetAllUsers

func GetAllUsers() []*User

* Turn the user map into a list so they can be sent to a rx client

func GetUser

func GetUser(username, password string) (*User, error)

* Return a user provided the username and Password If the Password is correct return user, else return err

func MakeUser

func MakeUser(uModel objects.User) (*User, error)

func RenewUser

func RenewUser(sessionToken string) (*User, error)

func (*User) LogoutUser

func (user *User) LogoutUser()

* Logout the user and decrement the active client count

func (*User) SetConfig

func (user *User) SetConfig(config map[string]interface{}) error

func (*User) SetDisplayName

func (user *User) SetDisplayName(displayName string) error

func (*User) SetPassword

func (user *User) SetPassword(pass string) error

Jump to

Keyboard shortcuts

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