data

package
v0.0.0-...-b030976 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBDrivers

func DBDrivers() []string

func RegisterDBDriver

func RegisterDBDriver(name string, driver DBdriver)

Types

type DBdriver

type DBdriver interface {
	OpenDatabase(db *sql.DB) error
	Close(db *sql.DB)
	InsertRow(db *sql.DB, timestamp int64, id string, channel int, serial string, key string, min float64, max float64, avg float64) error
	QueryWind(db *sql.DB, start int64, key string, col string, id string, channel int) (*sql.Rows, error)
	QueryFirst(db *sql.DB, start int64, key string, id string, channel int) (float64, error)
	QueryLast(db *sql.DB, start int64, key string, id string, channel int) (float64, error)
	QueryRows(db *sql.DB, start int64, key string, id string) (*sql.Rows, error)
	QueryRowsInterval(db *sql.DB, start int64, key string, id string, interval int64) (*sql.Rows, error)
}

type Database

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

func OpenDatabase

func OpenDatabase() (*Database, error)

func (*Database) Close

func (database *Database) Close()

func (*Database) InsertRow

func (database *Database) InsertRow(timestamp int64, id string, channel int, serial string, key string, min float64, max float64, avg float64) error

func (*Database) QueryFirst

func (database *Database) QueryFirst(start int64, key string, id string, channel int) (float64, error)

func (*Database) QueryLast

func (database *Database) QueryLast(start int64, key string, id string, channel int) (float64, error)

func (*Database) QueryRows

func (database *Database) QueryRows(start int64, key string, id string) <-chan Row

func (*Database) QueryRowsInterval

func (database *Database) QueryRowsInterval(start int64, key string, id string, interval int64) <-chan Row

func (*Database) QueryWind

func (database *Database) QueryWind(start int64, key string, col string, id string, channel int) <-chan WindRow

type Row

type Row struct {
	Timestamp     int64
	Min, Max, Avg float64
}

type SensorData

type SensorData struct {
	TimeStamp time.Time
	ID        string
	Channel   int
	Serial    string
	Data      map[string]float64
}

type SensorParser

type SensorParser interface {
	Parse(key string, data string) SensorData
}

type WindRow

type WindRow struct {
	Dir   float64
	Value float64
}

Jump to

Keyboard shortcuts

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