Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Close()
- func (db *DB) Get(key string, value interface{}) error
- func (db *DB) GetSensorInfo(name string) (gears.SensorInfo, error)
- func (db *DB) Iterate(from, to string, value interface{}, fun func(key string) error) error
- func (db *DB) NewProcessor() func(chan gears.RFMessage)
- func (db *DB) Put(key string, value interface{}) error
- func (db *DB) PutRFMessage(m gears.RFMessage) error
- func (db *DB) PutSensorInfo(name string, m gears.SensorInfo) error
- func (db *DB) PutSensorValue(name string, m gears.SensorDataValue) error
- func (db *DB) RFIterate(start, end int64, handle func(m gears.RFMessage) error) error
- func (db *DB) RFPublish(m gears.RFMessage)
- func (db *DB) RFSubscribe(start int64) chan gears.RFMessage
- func (db *DB) RFUnsubscribe(c chan gears.RFMessage)
- func (db *DB) SensorIterate(name string, start, end int64, handle func(m gears.SensorDataValue) error) error
- func (db *DB) SensorPublish(name string, m gears.SensorDataValue)
- func (db *DB) SensorSubscribe(name string, start int64) chan gears.SensorDataValue
- func (db *DB) SensorUnsubscribe(c chan gears.SensorDataValue)
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = fmt.Errorf("key not found")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Get ¶
Get performs a key lookup in the store and returns the value. It handles decoding the value into the interface provided using msgPack.
func (*DB) GetSensorInfo ¶
func (db *DB) GetSensorInfo(name string) (gears.SensorInfo, error)
func (*DB) Iterate ¶
Iterate over a key range, start inclusive, end exclusive. The value is always placed into the 'value' interface in order to allow typing. If fun returns an error the iteration is aborted.
func (*DB) NewProcessor ¶
func (*DB) Put ¶
Puts a new value into the database. Handles encoding using msgPack. Putting nil deletes an existing key-value pair
func (*DB) PutSensorInfo ¶
func (db *DB) PutSensorInfo(name string, m gears.SensorInfo) error
func (*DB) PutSensorValue ¶
func (db *DB) PutSensorValue(name string, m gears.SensorDataValue) error
func (*DB) RFUnsubscribe ¶
func (*DB) SensorIterate ¶
func (*DB) SensorPublish ¶
func (db *DB) SensorPublish(name string, m gears.SensorDataValue)
Push a sensor message, which stores it in the database and forwards it to all sensorSubscribers.
func (*DB) SensorSubscribe ¶
func (db *DB) SensorSubscribe(name string, start int64) chan gears.SensorDataValue
Subscribe to Sensor messages starting at the timestamp given by start in milliseconds since the epoch, returns a channel to read messages from.
func (*DB) SensorUnsubscribe ¶
func (db *DB) SensorUnsubscribe(c chan gears.SensorDataValue)
Unsubscribe the given channel from sensor messages. This will (asynchronously) cause the channel to be closed.