add Record and Note types

This commit is contained in:
agatha 2024-05-12 14:13:24 -04:00
parent 174173f99b
commit e5ab7ec5ef

12
main.go
View File

@ -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"`