user

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2014 License: BSD-2-Clause Imports: 6 Imported by: 21

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()

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"`
	CustomFields interface{} `bson:"custom_fields" json:"custom_fields"`
}

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