Skip to content
Permalink
Browse files

add bolthold tags on sample struct

  • Loading branch information...
cbrake committed Aug 8, 2019
1 parent e9142a9 commit 0d24152e71022cb662d14c7e96925758957fdf0c
Showing with 10 additions and 2 deletions.
  1. +10 −2 data/sample.go
@@ -2,11 +2,19 @@ package data

import "time"

// define common sample types
const (
SampleTypeStartApp string = "startApp"
SampleTypeStartSystem = "startSystem"
SampleTypeUpdateOS = "updateOS"
SampleTypeUpdateApp = "updateApp"
)

// Sample represents a value in time and should include data that may be
// graphed.
type Sample struct {
// Type of sample (voltage, current, key, etc)
Type string `json:"type,omitempty"`
Type string `json:"type,omitempty" boltholdIndex:"Type"`

// ID of the device that provided the sample
ID string `json:"id,omitempty"`
@@ -21,7 +29,7 @@ type Sample struct {
Max float64 `json:"max,omitempty"`

// Time the sample was taken
Time time.Time `json:"time,omitempty"`
Time time.Time `json:"time,omitempty" boltholdKey:"Time" gob:"-"`

// Duration over which the sample was taken
Duration time.Duration `json:"duration,omitempty"`

0 comments on commit 0d24152

Please sign in to comment.
You can’t perform that action at this time.