iot

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventBinding = event_{
	Id:  1,
	Uid: 1468539308767086854,
}
View Source
var ReadingBinding = reading_{
	Id:  2,
	Uid: 5284076134434938613,
}

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`
}

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) Remove

func (box *EventBox) Remove(entity *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
}

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) Remove

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

Jump to

Keyboard shortcuts

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