iot

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventBinding = event_EntityInfo{
	Id:  1,
	Uid: 1468539308767086854,
}
View Source
var Event_ = struct {
	Id      objectbox.TypeId
	Uid     objectbox.TypeId
	Device  objectbox.TypeId
	Date    objectbox.TypeId
	Picture objectbox.TypeId
}{
	Id:      1,
	Uid:     4,
	Device:  2,
	Date:    3,
	Picture: 5,
}
View Source
var ReadingBinding = reading_EntityInfo{
	Id:  2,
	Uid: 5284076134434938613,
}
View Source
var Reading_ = struct {
	Id              objectbox.TypeId
	Date            objectbox.TypeId
	EventId         objectbox.TypeId
	ValueName       objectbox.TypeId
	ValueString     objectbox.TypeId
	ValueInteger    objectbox.TypeId
	ValueFloating   objectbox.TypeId
	ValueInt32      objectbox.TypeId
	ValueFloating32 objectbox.TypeId
}{
	Id:              1,
	Date:            2,
	EventId:         3,
	ValueName:       4,
	ValueString:     5,
	ValueInteger:    6,
	ValueFloating:   7,
	ValueInt32:      8,
	ValueFloating32: 9,
}

Functions

func LoadEmptyTestObjectBox

func LoadEmptyTestObjectBox() *objectbox.ObjectBox

func ObjectBoxModel

func ObjectBoxModel() *objectbox.Model

Types

type Event

type Event struct {
	Id      uint64 `id`
	Uid     string `unique`
	Device  string
	Date    int64 `date`
	Picture []byte
}

func PutEvent

func PutEvent(ob *objectbox.ObjectBox, device string, date int64) *Event

func PutEvents

func PutEvents(ob *objectbox.ObjectBox, count int) []*Event

type EventBox

type EventBox struct {
	*objectbox.Box
}

func BoxForEvent

func BoxForEvent(ob *objectbox.ObjectBox) *EventBox

func (*EventBox) Get

func (box *EventBox) Get(id uint64) (*Event, error)

func (*EventBox) GetAll

func (box *EventBox) GetAll() ([]*Event, error)

func (*EventBox) Put added in v0.7.0

func (box *EventBox) Put(object *Event) (uint64, error)

func (*EventBox) PutAll added in v0.7.0

func (box *EventBox) PutAll(objects []*Event) ([]uint64, error)

func (*EventBox) PutAsync added in v0.7.0

func (box *EventBox) PutAsync(object *Event) (uint64, error)

func (*EventBox) Remove

func (box *EventBox) Remove(object *Event) (err error)

type Reading

type Reading struct {
	Id   uint64 `id`
	Date int64  `date`

	/// to-one relation
	EventId uint64 `link:"Event"`

	ValueName string

	/// Device sensor data value
	ValueString string

	/// Device sensor data value
	ValueInteger int64

	/// Device sensor data value
	ValueFloating float64

	/// Device sensor data value
	ValueInt32 int32

	/// Device sensor data value
	ValueFloating32 float32
}

func PutReading added in v0.7.0

func PutReading(ob *objectbox.ObjectBox, name string, ValueString string, ValueInteger int64, ValueFloating float64, ValueInt32 int32, ValueFloating32 float32) *Reading

func PutReadings added in v0.7.0

func PutReadings(ob *objectbox.ObjectBox, count int) []*Reading

type ReadingBox

type ReadingBox struct {
	*objectbox.Box
}

func BoxForReading

func BoxForReading(ob *objectbox.ObjectBox) *ReadingBox

func (*ReadingBox) Get

func (box *ReadingBox) Get(id uint64) (*Reading, error)

func (*ReadingBox) GetAll

func (box *ReadingBox) GetAll() ([]*Reading, error)

func (*ReadingBox) Put added in v0.7.0

func (box *ReadingBox) Put(object *Reading) (uint64, error)

func (*ReadingBox) PutAll added in v0.7.0

func (box *ReadingBox) PutAll(objects []*Reading) ([]uint64, error)

func (*ReadingBox) PutAsync added in v0.7.0

func (box *ReadingBox) PutAsync(object *Reading) (uint64, error)

func (*ReadingBox) Remove

func (box *ReadingBox) Remove(object *Reading) (err error)

Jump to

Keyboard shortcuts

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