Documentation ¶
Index ¶
- func CleanupTestData()
- func GenerateDemoData()
- func GenerateDemoReadings(b *Batch)
- func GetTestObjects() (*Hydrometer, *Hydrometer, *Batch, *Batch)
- func InitMongo(dbAddr string, database string) error
- type Batch
- func (b *Batch) AddReading(r GravityReading) error
- func (b *Batch) ArchiveBatch() error
- func (b *Batch) CalculateGravityDelta() float64
- func (b *Batch) FinishBatch() error
- func (b *Batch) HideReadingID(id bson.ObjectId) error
- func (b *Batch) Save() error
- func (b *Batch) SetHydrometer(h *Hydrometer) error
- func (b *Batch) SetHydrometerID(hID bson.ObjectId) error
- type GravityReading
- type Hydrometer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTestData ¶
func CleanupTestData()
func GenerateDemoData ¶
func GenerateDemoData()
GenerateDemoData populates the database with some example information.
func GenerateDemoReadings ¶
func GenerateDemoReadings(b *Batch)
GenerateDemoReadings generates a full time series of readings for the given batch, spaced a half hour apart.
func GetTestObjects ¶
func GetTestObjects() (*Hydrometer, *Hydrometer, *Batch, *Batch)
Types ¶
type Batch ¶
type Batch struct { ID bson.ObjectId `bson:"_id,omitempty"` RecipeName string `bson:"recipe"` UniqueID string `bson:"stringId"` HydrometerID bson.ObjectId `bson:"hydrometer"` GravityReadings []GravityReading `bson:"readings"` StartDate time.Time `bson:"startDate"` LastUpdate time.Time `bson:"lastUpdate"` Active bool `bson:"active"` Archived bool `bson:"archived"` }
func (*Batch) AddReading ¶
func (b *Batch) AddReading(r GravityReading) error
func (*Batch) ArchiveBatch ¶
func (*Batch) CalculateGravityDelta ¶
func (*Batch) FinishBatch ¶
func (*Batch) SetHydrometer ¶
func (b *Batch) SetHydrometer(h *Hydrometer) error
type GravityReading ¶
type GravityReading struct { ID bson.ObjectId `json:"id" bson:"_id"` Date time.Time `json:"date" bson:"date"` Gravity float64 `json:"gravity" bson:"gravity"` Temperature float64 `json:"temperature" bson:"temperature"` BatteryVoltage float64 `json:"battery" bson:"battery"` Hidden bool `json:"hidden" bson:"hidden"` }
type Hydrometer ¶
type Hydrometer struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string `bson:"name"` Description string `bson:"description"` CurrentBatchID bson.ObjectId `bson:"batch"` Archived bool `bson:"archived"` }
func QueryHydrometers ¶
func QueryHydrometers(query bson.M) ([]*Hydrometer, error)
func SingleHydrometer ¶
func SingleHydrometer(query bson.M) (*Hydrometer, error)
func (*Hydrometer) Save ¶
func (h *Hydrometer) Save() error
Click to show internal directories.
Click to hide internal directories.