Documentation ¶
Index ¶
- Variables
- func Connect(address, database string) error
- func GetUserByID(id string) (m.User, error)
- func SetupDB(bootstrap, testData bool)
- type AssignmentStore
- type AssignmentTypeStore
- type DefaultStore
- func (d DefaultStore) Delete(id string) error
- func (d *DefaultStore) Filter(data interface{}, filter interface{}) error
- func (d DefaultStore) FindAll(data interface{}) error
- func (d DefaultStore) FindByID(data m.Model, id string) error
- func (d *DefaultStore) Store(v m.Model) (string, error)
- func (d *DefaultStore) Update(v m.Model, id string) error
- type EnrollmentStore
- type SessionStore
- type Storer
- type UserStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DB Global DB object DB rh.DB // Classes ClassStore Enrollments EnrollmentStore Classes = DB.NewCollection("classes") Terms = DB.NewCollection("terms") EnrollmentH = DB.NewCollection("enrollments") People = DB.NewCollection("people") UserH = DB.NewCollection("users") AssignmentH = DB.NewCollection("assignments") AssignmentGrades = DB.NewCollection("grades") Assignments AssignmentStore AssignmentTypes AssignmentTypeStore Sessions SessionStore Users UserStore // Errors ErrNotFound = errors.New("record not found") ErrValidation = errors.New("validation error") )
View Source
var ( //ErrUserOrPasswdIncorrect err for password incorrect ErrUserOrPasswdIncorrect = errors.New("Email or password incorrect.") //ErrUserAlreadyExists err for duplicate user ErrUserAlreadyExists = errors.New("User with email already exists.") //ErrUserForPersonExists err for duplicate person ErrUserForPersonExists = errors.New("User for person already exists.") //ErrUserPasswordRequired err for trying to save without a password. // TODO: Remove this after refactoring. ErrUserPasswordRequired = errors.New("Password is required") )
Functions ¶
Types ¶
type AssignmentStore ¶
type AssignmentStore struct {
DefaultStore
}
func NewAssignmentStore ¶
func NewAssignmentStore() AssignmentStore
func (*AssignmentStore) BeforeSave ¶
func (a *AssignmentStore) BeforeSave(v *m.Assignment) error
BeforeSave ...
func (AssignmentStore) Store ¶
func (a AssignmentStore) Store(v *m.Assignment) (string, error)
type AssignmentTypeStore ¶
type AssignmentTypeStore struct {
DefaultStore
}
func NewAssignmentTypeStore ¶
func NewAssignmentTypeStore() AssignmentTypeStore
type DefaultStore ¶
type DefaultStore struct {
TableName string
}
DefaultStore ...
func (*DefaultStore) Filter ¶
func (d *DefaultStore) Filter(data interface{}, filter interface{}) error
type EnrollmentStore ¶
type EnrollmentStore struct {
DefaultStore
}
func NewEnrollmentStore ¶
func NewEnrollmentStore() EnrollmentStore
func (EnrollmentStore) Filter ¶
func (pr EnrollmentStore) Filter(enrollments *[]m.EnrollmentAPIRes, filter interface{}) error
type SessionStore ¶
type SessionStore struct {
DefaultStore
}
func NewSessionStore ¶
func NewSessionStore() SessionStore
type Storer ¶
type Storer interface { Store(m.Model) (string, error) Update(m.Model, string) error FindAll(interface{}) error FindByID(m.Model, string) error }
Storer interface
type UserStore ¶
type UserStore struct {
DefaultStore
}
UserStore used to interact with db users
func (*UserStore) FindByEmail ¶
FindByEmail finds a single user that matches an email.
Click to show internal directories.
Click to hide internal directories.