Documentation ¶
Index ¶
- func OpenDatabase(path string, connectionPtr *DB) error
- type DB
- func (db *DB) CreateOutputWriter(projectName string, projectOwner string, commitID string, job string) (func(string, string) (int64, error), int64, error)
- func (db *DB) FindAllProjects() (*[]Project, error)
- func (db *DB) FindJobWithData(jobID int64) (*Job, error)
- func (db *DB) FindJobsForProject(projectID int64) ([]Job, error)
- func (db *DB) FindProjectByID(id int64) (*Project, error)
- func (db *DB) GetLatestJobID() int64
- func (db *DB) UpdateJobStatus(jobID int64, status JobStatus, extra string) error
- type Job
- type JobStatus
- type Output
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenDatabase ¶
OpenDatabase opens a QL embedded database connection to a db at a certain path.
Types ¶
type DB ¶
var DBConn DB
func (*DB) CreateOutputWriter ¶
func (db *DB) CreateOutputWriter(projectName string, projectOwner string, commitID string, job string) (func(string, string) (int64, error), int64, error)
CreateOutputWriter returns a function that can be used to write to the "Output" table. That table is used to write test output to. Test output belongs to a certain job, which in turn belongs to a project. Before returning the writer we make sure these tuples exist or are created. Returns the writer function, the job ID and an error in case anything goes wrong.
func (*DB) FindAllProjects ¶
FindAllProjects returns all the projects. Used for the webapi get "api/projects/".
func (*DB) FindJobWithData ¶
FindJobWithData finds a job and returns it, with all the Output data related to it already fetched.
func (*DB) FindJobsForProject ¶
Find all jobs that belong to a specific project. This doesn't query the data belonging to every job. Used for the webapi get "api/projects/:ProjectID/jobs".
func (*DB) FindProjectByID ¶
FindProjectById find a single project by its ID. Used for the webapi get "api/projects/:ProjectID".
func (*DB) GetLatestJobID ¶
GetLatestJobID returns the latest jobID. The return value will be < 1 if no job was found.