adapter

package
v0.0.0-...-35ec728 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogicToModel

func LogicToModel(l *Logic) (model.Logic, error)

func LogicsToModel

func LogicsToModel(ll []Logic) []model.Logic

Types

type Element

type Element struct {
	Elem string                 `json:"elem"`
	Arg  map[string]interface{} `json:"arg"`
}

type Location

type Location struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type Logic

type Logic struct {
	ID        int          `json:"id"`
	LogicName string       `json:"logic_name"`
	Elems     []Element    `json:"elems"`
	SensorID  int          `json:"sensor_id"`
	Sensor    model.Sensor `json:"sensor"`
}

func LogicToAdapter

func LogicToAdapter(ml *model.Logic) (Logic, error)

func LogicsToAdapter

func LogicsToAdapter(mll []model.Logic) []Logic

type Node

type Node struct {
	ID       int            `json:"id"`
	Name     string         `json:"name"`
	Location Location       `json:"location"`
	SinkID   int            `json:"sink_id"`
	Sink     model.Sink     `json:"sink"`
	Sensors  []model.Sensor `json:"sensors"`
}

type NodePage

type NodePage struct {
	Nodes []model.Node `json:"nodes"`
	Pages int          `json:"pages"`
}

type Page

type Page struct {
	Page int `form:"page" json:"page"`
	Sink int `form:"sink" json:"sink"`
	Size int `form:"size" json:"size"`
}

func (Page) GetOffset

func (p Page) GetOffset() int

func (Page) IsBinded

func (p Page) IsBinded() bool

type SensorPage

type SensorPage struct {
	Sensors []model.Sensor `json:"sensors"`
	Pages   int            `json:"pages"`
}

type SinkPage

type SinkPage struct {
	Sinks []model.Sink `json:"sinks"`
	Pages int          `json:"pages"`
}

type Square

type Square struct {
	Left  float64 `form:"left" json:"left"`
	Right float64 `form:"right" json:"right"`
	Up    float64 `form:"up" json:"up"`
	Down  float64 `form:"down" json:"down"`
}

func (Square) IsBinded

func (sq Square) IsBinded() bool

Jump to

Keyboard shortcuts

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