storage

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store storage structure

func NewStore

func NewStore(storageLocation string, maxToKeep int) *Store

NewStore create a new store for persisting data

func (*Store) GetTemperatureData

func (s *Store) GetTemperatureData() (map[string][]Thermostat, error)

GetTemperatureData reads the temperatureData from storage

func (*Store) SaveTemperatureResult

func (s *Store) SaveTemperatureResult(tick time.Time, thermostats map[string]*nest.Thermostat) error

SaveTemperatureResult persists temperature data

type Thermostat

type Thermostat struct {
	ID           string        `json:"id"`
	Name         string        `json:"name"`
	Temperatures []temperature `json:"temperatures"`
}

Thermostat contains all stored temperatures for a thermostat

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL