Documentation
¶
Overview ¶
Package store implements the SIOT data store and processes messages. Currently data is stored in Genji and Influxdb. Direct DB access is not provided and all write data goes through NATS, thus making it easy to observe any data changes.
Index ¶
Constants ¶
const ( StoreTypeMemory Type = "memory" StoreTypeBolt = "bolt" StoreTypeBadger = "badger" )
define valid store types
Variables ¶
var DBVersion = 1
DBVersion for this version of siot
Functions ¶
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db represents the store for the application FIXME, Db should be made private at some point and make the dump and import functions part of the store type.
type Influx ¶
type Influx struct {
// contains filtered or unexported fields
}
Influx represents and influxdb that we can write points to
func NewInflux ¶
func NewInflux(config *InfluxConfig) *Influx
NewInflux creates an influx helper client
func (*Influx) CheckConfig ¶
func (i *Influx) CheckConfig(config *InfluxConfig)
CheckConfig checks influx config and re-init if necessary
type InfluxConfig ¶
InfluxConfig represents an influxdb config
func NodeToInfluxConfig ¶
func NodeToInfluxConfig(node data.NodeEdge) (*InfluxConfig, error)
NodeToInfluxConfig converts a node to an influx config
type NewTokener ¶ added in v0.0.45
NewTokener provides a new authentication token.
type Params ¶ added in v0.3.0
type Params struct {
Type Type
DataDir string
AuthToken string
Server string
Key NewTokener
Nc *nats.Conn
}
Params are used to configure a store
type Store ¶ added in v0.3.0
type Store struct {
// contains filtered or unexported fields
}
Store implements the SIOT NATS api
func (*Store) Start ¶ added in v0.3.0
Start connects to NATS server and set up handlers for things we are interested in
func (*Store) StartMetrics ¶ added in v0.3.0
StartMetrics for various handling operations. Metrics are sent to the node ID given FIXME, this can probably move to the node package for device nodes
func (*Store) StartUpdate ¶ added in v0.3.0
StartUpdate starts an update