add Record and Note types
This commit is contained in:
parent
174173f99b
commit
e5ab7ec5ef
12
main.go
12
main.go
@ -36,6 +36,18 @@ func init() {
|
|||||||
readingsFilename = filepath.Join(ketotrackDir, "readings.json")
|
readingsFilename = filepath.Join(ketotrackDir, "readings.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Record holds a pointer to a Reading or Note.
|
||||||
|
type Record struct {
|
||||||
|
Reading *Reading `json:"reading,omitempty"`
|
||||||
|
Note *Note `json:"note,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note holds a text note along with the time the note was taken.
|
||||||
|
type Note struct {
|
||||||
|
Time time.Time `json:"time"`
|
||||||
|
Text string `json:"text"`
|
||||||
|
}
|
||||||
|
|
||||||
// Reading holds the glucose and ketone level measurements along with the time the measurements were taken.
|
// Reading holds the glucose and ketone level measurements along with the time the measurements were taken.
|
||||||
type Reading struct {
|
type Reading struct {
|
||||||
Time time.Time `json:"time"`
|
Time time.Time `json:"time"`
|
||||||
|
Loading…
Reference in New Issue
Block a user