repository

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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

func (*Assignments) Update

func (repo *Assignments) Update(assignmentID int, answer string, duration int) error

Update updates the Assignment identified by the given user and pair IDs, with the given answer and duration

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

func NewFeatures(db *sql.DB) *Features

NewFeatures returns a new Features repository

func (*Features) GetAll

func (repo *Features) GetAll(blobID string) ([]*model.Feature, error)

GetAll returns a list of all features for blobID

type FilePairs

type FilePairs struct {
	// contains filtered or unexported fields
}

FilePairs repository

func NewFilePairs

func NewFilePairs(db *sql.DB) *FilePairs

NewFilePairs returns a new FilePairs repository

func (*FilePairs) GetAll

func (repo *FilePairs) GetAll(experimentID int) ([]*model.FilePair, error)

GetAll returns all the FilePairs for the given experiment ID

func (*FilePairs) GetByID

func (repo *FilePairs) GetByID(id int) (*model.FilePair, error)

GetByID returns the FilePair with the given ID. If the FilePair does not exist, it returns nil, nil

type Users

type Users struct {
	// contains filtered or unexported fields
}

Users repository

func NewUsers

func NewUsers(db *sql.DB) *Users

NewUsers returns a new Users repository

func (*Users) Create

func (repo *Users) Create(user *model.User) error

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

func (repo *Users) Get(login string) (*model.User, error)

Get returns the User with the given GitHub login name. If the User does not exist, it returns nil, nil

func (*Users) GetByID

func (repo *Users) GetByID(id int) (*model.User, error)

GetByID returns the User with the given ID. If the User does not exist, it returns nil, nil

func (*Users) Update added in v0.0.1

func (repo *Users) Update(user *model.User) error

Update the given user in the database

Jump to

Keyboard shortcuts

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