Documentation ¶
Index ¶
- func Connect(path string) (sess db.Session, err error)
- func RunMigrations(sess *sql.DB) error
- type Database
- func (d *Database) AddTestKeys(msmt *model.DatabaseMeasurement, tk any) error
- func (d *Database) Close() error
- func (d *Database) CreateMeasurement(reportID sql.NullString, testName string, measurementDir string, idx int, ...) (*model.DatabaseMeasurement, error)
- func (d *Database) CreateNetwork(loc model.LocationProvider) (*model.DatabaseNetwork, error)
- func (d *Database) CreateOrUpdateURL(urlStr string, categoryCode string, countryCode string) (int64, error)
- func (d *Database) CreateResult(homePath string, testGroupName string, networkID int64) (*model.DatabaseResult, error)
- func (d *Database) DeleteResult(resultID int64) error
- func (d *Database) Done(msmt *model.DatabaseMeasurement) error
- func (d *Database) Failed(msmt *model.DatabaseMeasurement, failure string) error
- func (d *Database) Finished(result *model.DatabaseResult) error
- func (d *Database) GetMeasurementJSON(msmtID int64) (map[string]interface{}, error)
- func (d *Database) ListMeasurements(resultID int64) ([]model.DatabaseMeasurementURLNetwork, error)
- func (d *Database) ListResults() ([]model.DatabaseResultNetwork, []model.DatabaseResultNetwork, error)
- func (d *Database) Session() db.Session
- func (d *Database) UpdateUploadedStatus(result *model.DatabaseResult) error
- func (d *Database) UploadFailed(msmt *model.DatabaseMeasurement, failure string) error
- func (d *Database) UploadSucceeded(msmt *model.DatabaseMeasurement) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMigrations ¶
RunMigrations runs the database migrations
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a database instance to store measurements
func (*Database) AddTestKeys ¶
func (d *Database) AddTestKeys(msmt *model.DatabaseMeasurement, tk any) error
AddTestKeys implements WritableDatabase.AddTestKeys
func (*Database) CreateMeasurement ¶
func (d *Database) CreateMeasurement(reportID sql.NullString, testName string, measurementDir string, idx int, resultID int64, urlID sql.NullInt64) (*model.DatabaseMeasurement, error)
CreateMeasurement implements WritableDatabase.CreateMeasurement
func (*Database) CreateNetwork ¶
func (d *Database) CreateNetwork(loc model.LocationProvider) (*model.DatabaseNetwork, error)
CreateNetwork implements WritableDatabase.CreateNetwork
func (*Database) CreateOrUpdateURL ¶
func (d *Database) CreateOrUpdateURL(urlStr string, categoryCode string, countryCode string) (int64, error)
CreateOrUpdateURL implements WritableDatabase.CreateOrUpdateURL
func (*Database) CreateResult ¶
func (d *Database) CreateResult(homePath string, testGroupName string, networkID int64) (*model.DatabaseResult, error)
CreateResult implements WritableDatabase.CreateResult
func (*Database) DeleteResult ¶
DeleteResult implements WritableDatabase.DeleteResult
func (*Database) Done ¶
func (d *Database) Done(msmt *model.DatabaseMeasurement) error
Done implements WritableDatabase.Done
func (*Database) Failed ¶
func (d *Database) Failed(msmt *model.DatabaseMeasurement, failure string) error
Failed implements WritableDatabase.Failed
func (*Database) Finished ¶
func (d *Database) Finished(result *model.DatabaseResult) error
Finished implements WritableDatabase.Finished
func (*Database) GetMeasurementJSON ¶
GetMeasurementJSON implements ReadableDatabase.GetMeasurementJSON
func (*Database) ListMeasurements ¶
func (d *Database) ListMeasurements(resultID int64) ([]model.DatabaseMeasurementURLNetwork, error)
ListMeasurements implements ReadableDatabase.ListMeasurements
func (*Database) ListResults ¶
func (d *Database) ListResults() ([]model.DatabaseResultNetwork, []model.DatabaseResultNetwork, error)
ListResults implements ReadableDatabase.ListResults
func (*Database) Session ¶
func (d *Database) Session() db.Session
Session implements Writable/ReadableDatabase.Session
func (*Database) UpdateUploadedStatus ¶
func (d *Database) UpdateUploadedStatus(result *model.DatabaseResult) error
UpdateUploadedStatus implements WritableDatabase.UpdateUploadedStatus
func (*Database) UploadFailed ¶
func (d *Database) UploadFailed(msmt *model.DatabaseMeasurement, failure string) error
UploadFailed implements WritableDatabase.UploadFailed
func (*Database) UploadSucceeded ¶
func (d *Database) UploadSucceeded(msmt *model.DatabaseMeasurement) error
UploadSucceeded implements WritableDatabase.UploadSucceeded