Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCategoryNotFound = "Could not find category"
View Source
var ErrCouldNotFindReleases = "Could not find releases"
View Source
var ErrInsertRelease = "Error returned when inserting release"
View Source
var ErrInsertUser = errors.New("Error inserting user into DB")
View Source
var ErrStrDeleteUser = "Error returned when deleting user"
View Source
var ErrStrUpdateUser = "Error returned when updating user"
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var NoMgoSess = "nil pointer passed from session to mongo"
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
Credentials represents user sign-in credentials
type MgoStore ¶
type MgoStore struct {
// contains filtered or unexported fields
}
implements UserStore interface
func NewMgoStore ¶
type NewUser ¶
type NewUser struct { Email string `json:"email"` Password string `json:"password"` PasswordConf string `json:"passwordConf"` FirstName string `json:"firstName"` LastName string `json:"lastName"` }
NewUser represents a new user signing up for an account
type User ¶
type User struct { ID bson.ObjectId `json:"id" bson:"_id"` Email string `json:"email"` PassHash []byte `json:"-"` //stored, but not encoded to clients FirstName string `json:"firstName"` LastName string `json:"lastName"` }
User represents a user account in the database
func (*User) Authenticate ¶
func (*User) SetPassword ¶
type UserStore ¶
type UserStore interface { //GetByID returns the User with the given ID GetByID(id bson.ObjectId) (*User, error) //GetByEmail returns the User with the given email GetByEmail(email string) (*User, error) //Insert converts the NewUser to a User, inserts //it into the database, and returns it Insert(newUser *NewUser) (*User, error) //Delete deletes the user with the given ID Delete(id bson.ObjectId) error }
Click to show internal directories.
Click to hide internal directories.