user

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: BSD-2-Clause Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminGet

func AdminGet(u *Users) (err error)

func Initialize

func Initialize() (err error)

Initialize creates a copy of the mongodb connection and then uses that connection to create the Users collection in mongodb. Then, it ensures that there is a unique index on the uuid key and the username key in this collection, creating the indexes if necessary.

Types

type User

type User struct {
	Uuid     string `bson:"uuid" json:"uuid"`
	Username string `bson:"username" json:"username"`
	Fullname string `bson:"fullname" json:"fullname"`
	Email    string `bson:"email" json:"email"`
	Password string `bson:"password" json:"-"`
	Admin    bool   `bson:"shock_admin" json:"shock_admin"`
}

User struct

func FindByUsernamePassword

func FindByUsernamePassword(username string, password string) (u *User, err error)

func FindByUuid

func FindByUuid(uuid string) (u *User, err error)

func New

func New(username string, password string, isAdmin bool) (u *User, err error)

func (*User) Save

func (u *User) Save() (err error)

func (*User) SetMongoInfo added in v0.8.12

func (u *User) SetMongoInfo() (err error)

type Users

type Users []User

Array of User

Jump to

Keyboard shortcuts

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