Start fleshing out database related functions
This commit is contained in:
parent
6008b5c7c5
commit
ca231bca9f
8 changed files with 511 additions and 12 deletions
34
internal/database/models.go
Normal file
34
internal/database/models.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package database
|
||||
|
||||
import "time"
|
||||
|
||||
// Measurement model
|
||||
type Measurement struct {
|
||||
ID int `db:"id"`
|
||||
Name string `db:"name"`
|
||||
StartTime time.Time `db:"startTime"`
|
||||
EndTime time.Time `db:"endTime"`
|
||||
Summary string `db:"summary"` // XXX this should be JSON
|
||||
ASN int `db:"asn"`
|
||||
IP string `db:"ip"`
|
||||
CountryCode string `db:"country"`
|
||||
State string `db:"state"`
|
||||
Failure string `db:"failure"`
|
||||
ReportFilePath string `db:"reportFile"`
|
||||
ReportID string `db:"reportId"`
|
||||
Input string `db:"input"`
|
||||
MeasurementID string `db:"measurementId"`
|
||||
ResultID string `db:"resultId"`
|
||||
}
|
||||
|
||||
// Result model
|
||||
type Result struct {
|
||||
ID int `db:"id"`
|
||||
Name int `db:"name"`
|
||||
StartTime time.Time `db:"startTime"`
|
||||
EndTime time.Time `db:"endTime"`
|
||||
Summary string `db:"summary"` // XXX this should be JSON
|
||||
Done bool `db:"done"`
|
||||
DataUsageUp int `db:"dataUsageUp"`
|
||||
DataUsageDown int `db:"dataUsageDown"`
|
||||
}
|
||||
Loading…
Reference in a new issue