db

package
v0.0.0-...-1ae953c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

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 Storage struct

func NewDatabase

func NewDatabase() *Database

NewDatabase make new struct

func (*Database) AddData

func (d *Database) AddData(sensor string, temp int, hum int, pres int) error

AddData add new record with meteo data

func (*Database) ClearData

func (d *Database) ClearData(sensor string) error

ClearData clear meteo values from sensor table

func (*Database) Close

func (d *Database) Close()

Close Unload database

func (*Database) Connect

func (d *Database) Connect(creds *DatabaseCreds) error

Connect Open database connection

func (*Database) DataByDate

func (d *Database) DataByDate(sensor string, date string) ([]MeteoData, error)

DataByDate Read sensor data by date

type DatabaseCreds

type DatabaseCreds struct {
	IP     string
	User   string
	Passwd string
	Base   string
}

DatabaseCreds Database credentionals

type MeteoData

type MeteoData struct {
	Sensor   string
	Temp     int
	Humidity int
	Pressure int
	Time     string
	Date     string
}

MeteoData Public meteo data

Jump to

Keyboard shortcuts

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