arasqlite

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package arasqlite provides an implementation of an aranet4 database, backed by SQlite3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Open

func Open(fname string) (*DB, error)

Open opens and initializes a sqlite3-backed aranet4 database.

func (*DB) AddDevice

func (db *DB) AddDevice(id string) (err error)

AddDevice declares a new device id

func (*DB) Close

func (db *DB) Close() error

Close closes an aranet4 database

func (*DB) Data

func (db *DB) Data(id string, beg, end time.Time) iter.Seq2[aranet4.Data, error]

Data iterates over data for the device id and the requested time interval [beg, end)

func (*DB) Devices

func (db *DB) Devices() ([]string, error)

Devices returns the device ids list

func (*DB) Last

func (db *DB) Last(id string) (aranet4.Data, error)

Last returns the last data point for the provided device id

func (*DB) PutData

func (db *DB) PutData(id string, vs []aranet4.Data) (err error)

PutData puts the provided data for the device id into the underlying store

Jump to

Keyboard shortcuts

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