Documentation
¶
Index ¶
- type Assignments
- func (repo *Assignments) CountCompleteUserAssignment(experimentID, userID int) (int, error)
- func (repo *Assignments) CountUserAssignment(experimentID, userID int) (int, error)
- func (repo *Assignments) GetAll(userID, experimentID int) ([]*model.Assignment, error)
- func (repo *Assignments) GetByExperimentPair(experimentID, filePairID int) ([]*model.Assignment, error)
- func (repo *Assignments) GetByID(id int) (*model.Assignment, error)
- func (repo *Assignments) Initialize(userID int, experimentID int) (int, error)
- func (repo *Assignments) IsInitialized(userID, experimentID int) (bool, error)
- func (repo *Assignments) Update(assignmentID int, answer string, duration int) error
- type Experiments
- type Features
- type FilePairs
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignments ¶
type Assignments struct {
// contains filtered or unexported fields
}
Assignments repository
func NewAssignments ¶
func NewAssignments(db *sql.DB) *Assignments
NewAssignments returns a new Assignments repository
func (*Assignments) CountCompleteUserAssignment ¶ added in v0.0.2
func (repo *Assignments) CountCompleteUserAssignment(experimentID, userID int) (int, error)
CountCompleteUserAssignment returns number of assigments with an answer in given experiment for the given user
func (*Assignments) CountUserAssignment ¶ added in v0.0.2
func (repo *Assignments) CountUserAssignment(experimentID, userID int) (int, error)
CountUserAssignment returns number of assigments in given experiment for the given user
func (*Assignments) GetAll ¶
func (repo *Assignments) GetAll(userID, experimentID int) ([]*model.Assignment, error)
GetAll returns all the Assignments for the given user and experiment IDs
func (*Assignments) GetByExperimentPair ¶
func (repo *Assignments) GetByExperimentPair(experimentID, filePairID int) ([]*model.Assignment, error)
GetByExperimentPair returns all the Assignments for the given experiment and pair IDs
func (*Assignments) GetByID ¶
func (repo *Assignments) GetByID(id int) (*model.Assignment, error)
GetByID returns the Assignment with the given ID. If the Assignment does not exist, it returns nil, nil
func (*Assignments) Initialize ¶
func (repo *Assignments) Initialize(userID int, experimentID int) (int, error)
Initialize builds the assignments for the given user and experiment IDs
func (*Assignments) IsInitialized ¶
func (repo *Assignments) IsInitialized(userID, experimentID int) (bool, error)
IsInitialized returns true if the assignments are initialized for the given user and experiment IDs. If it's false, Initialize should be called
type Experiments ¶
type Experiments struct {
// contains filtered or unexported fields
}
Experiments repository
func NewExperiments ¶
func NewExperiments(db *sql.DB) *Experiments
NewExperiments returns a new Experiments repository
func (*Experiments) GetAll ¶ added in v0.0.2
func (repo *Experiments) GetAll() ([]*model.Experiment, error)
GetAll returns all the Experiments
func (*Experiments) GetByID ¶
func (repo *Experiments) GetByID(id int) (*model.Experiment, error)
GetByID returns the Experiment with the given ID. If the Experiment does not exist, it returns nil, nil
type Features ¶
type Features struct {
// contains filtered or unexported fields
}
Features repository
func NewFeatures ¶
NewFeatures returns a new Features repository
type FilePairs ¶
type FilePairs struct {
// contains filtered or unexported fields
}
FilePairs repository
func NewFilePairs ¶
NewFilePairs returns a new FilePairs repository
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users repository
func (*Users) Create ¶
Create stores a User into the DB. If the User is created, the argument is updated to point to that new User
func (*Users) Get ¶
Get returns the User with the given GitHub login name. If the User does not exist, it returns nil, nil