db

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package db implements a database for storing the history of the state of the CX34

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database stores historical values of the heat pump's state.

func Open

func Open(dir string) (*Database, error)

Open returns a databased stored in the given directory.

func (*Database) HistorianService

func (db *Database) HistorianService() *Service

HistorianService returns an implementation of chiltrix.Historian.

func (*Database) ReadSnapshots

func (db *Database) ReadSnapshots(start, end time.Time) ([]*chiltrix.State, error)

ReadSnapshots reads a set of snapshots from the database based on a time range.

func (*Database) RestoreBackup added in v0.0.3

func (db *Database) RestoreBackup(badgerBackupFilePath string) error

func (*Database) WriteSnapshot

func (db *Database) WriteSnapshot(state *chiltrix.State) error

WriteSnapshot writes a snaptshot of the heatpump state to the database.

type Service

type Service struct {
	chiltrix.UnimplementedHistorianServer
	// contains filtered or unexported fields
}

Service implements chiltrix.HistorianServer and is backed by a Database object.

func (*Service) QueryStream

QueryStream returns a stream of State values based on a query.

Jump to

Keyboard shortcuts

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