user

package
v0.0.0-...-a51df50 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserExistsByEmail

func UserExistsByEmail(email string, database *db.DB) bool

func UserExistsByName

func UserExistsByName(username string, database *db.DB) bool

Types

type User

type User struct {
	ObjID   primitive.ObjectID `bson:"_id,omitempty"`
	NAME    string             `bson:"NAME"`
	PASSWD  string             `bson:"PASSWD"`
	ID      string             `bson:"ID"`
	EMAIL   string             `bson:"EMAIL"`
	YubiKey string             `bson:"YubiKey"`
	ADMIN   bool               `bson:"ADMIN"`
}

func CreateUser

func CreateUser(username, passwd, EMAIL, Yubikey string, Admin bool, database *db.DB) (newUser User, err error)

func FindUserByEmail

func FindUserByEmail(email string, database *db.DB) User

func FindUserByName

func FindUserByName(name string, database *db.DB) User

func FindUserByUserID

func FindUserByUserID(UserID string, database *db.DB) User

func FindUserOne

func FindUserOne(query bson.D, database *db.DB) User

func (*User) CheckPassword

func (user *User) CheckPassword(passwd string) bool

func (*User) Delete

func (user *User) Delete(database *db.DB)

func (*User) Update

func (user *User) Update(database *db.DB) bool

Jump to

Keyboard shortcuts

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