models

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevCommandConfig

type DevCommandConfig struct {
}

type DevModBusConfig

type DevModBusConfig struct {
	SlaveId  int    `json:"slave_id" mapstructure:"slave_id"`   // 1-32
	Baud     int    `json:"baud"`                               // 9600, 19200, ...
	DataBits int    `json:"data_bits" mapstructure:"data_bits"` // 5-9
	StopBits int    `json:"stop_bits" mapstructure:"stop_bits"` // 1, 2
	Parity   string `json:"parity"`                             // none, odd, even
	Timeout  int    `json:"timeout"`                            // milliseconds
}

type DevSmartBusConfig

type DevSmartBusConfig struct {
	Baud     int `json:"baud" valid:"Required"`
	Device   int `json:"device"`
	Timeout  int `json:"timeout" valid:"Required"`
	StopBits int `json:"stop_bits" valid:"Required" mapstructure:"stop_bits"`
	Sleep    int `json:"sleep"`
}

type Device

type Device struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	//Node        *Node            `json:"node"`
	Properties DeviceProperties `json:"properties"`
	Type       string           `json:"type"`
	Status     string           `json:"status"`
	IsGroup    bool             `json:"is_group"`
	Actions    []DeviceAction   `json:"actions"`
	States     []DeviceState    `json:"states"`
	Device     *ParentDevice    `json:"device"`
	DeviceId   *int64           `json:"device_id"`
}

swagger:model

type DeviceAction

type DeviceAction struct {
	Id          int64               `json:"id"`
	Name        string              `json:"name" valid:"MaxSize(254);Required"`
	Description string              `json:"description"`
	Device      *DeviceActionDevice `json:"device"`
	DeviceId    int64               `json:"device_id"`
	Script      *DeviceActionScript `json:"script"`
}

swagger:model

type DeviceActionDevice

type DeviceActionDevice struct {
	Id int64 `json:"id"`
}

type DeviceActionScript

type DeviceActionScript struct {
	Id int64 `json:"id"`
}

type DeviceProperties

type DeviceProperties struct {
	// swagger:allOf
	DevModBusConfig
	// swagger:allOf
	DevSmartBusConfig
	// swagger:allOf
	DevCommandConfig
}

An AllOfModel is composed out of embedded structs but it should build an allOf property

type DeviceShort

type DeviceShort struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Status      string `json:"status"`
	Type        string `json:"type"`
}

swagger:model

type DeviceState

type DeviceState struct {
	Id          int64              `json:"id"`
	Description string             `json:"description"`
	SystemName  string             `json:"system_name" valid:"MaxSize(254);Required"`
	Device      *DeviceStateDevice `json:"device" valid:"Required"`
	DeviceId    int64              `json:"device_id"`
}

swagger:model

type DeviceStateDevice

type DeviceStateDevice struct {
	Id int64 `json:"id"`
}

type Image

type Image struct {
	Id    int64  `json:"id"`
	Thumb string `json:"thumb,omitempty"`
	Url   string `json:"url"`
}

swagger:model

type Map

type Map struct {
	Id          int64      `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Options     MapOptions `json:"options"`
}

swagger:model

type MapDevice

type MapDevice struct {
	Id         int64              `json:"id"`
	SystemName string             `json:"system_name" valid:"Required"`
	Device     *Device            `json:"-"`
	DeviceId   int64              `json:"device_id" valid:"Required"`
	Image      *Image             `json:"image"`
	ImageId    int64              `json:"image_id"`
	Actions    []*MapDeviceAction `json:"actions"`
	States     []*MapDeviceState  `json:"states"`
}

type MapDeviceAction

type MapDeviceAction struct {
	Id             int64         `json:"id"`
	DeviceAction   *DeviceAction `json:"device_action"`
	DeviceActionId int64         `json:"device_action_id" valid:"Required"`
	MapDeviceId    int64         `json:"map_device_id" valid:"Required"`
	Image          *Image        `json:"image"`
	ImageId        int64         `json:"image_id" valid:"Required"`
	Type           string        `json:"type"`
}

func (MapDeviceAction) MarshalJSON

func (n MapDeviceAction) MarshalJSON() (b []byte, err error)

type MapDeviceState

type MapDeviceState struct {
	Id            int64        `json:"id"`
	DeviceState   *DeviceState `json:"device_state"`
	DeviceStateId int64        `json:"device_state_id" valid:"Required"`
	MapDeviceId   int64        `json:"map_device_id" valid:"Required"`
	Image         *Image       `json:"image"`
	ImageId       int64        `json:"image_id" valid:"Required"`
	Style         string       `json:"style"`
}

func (MapDeviceState) MarshalJSON

func (n MapDeviceState) MarshalJSON() (b []byte, err error)

type MapElement

type MapElement struct {
	Id            int64                   `json:"id"`
	Name          string                  `json:"name"`
	Description   string                  `json:"description"`
	PrototypeId   int64                   `json:"prototype_id"`
	PrototypeType string                  `json:"prototype_type"`
	Prototype     Prototype               `json:"prototype"`
	MapId         int64                   `json:"map_id"`
	LayerId       int64                   `json:"layer_id"`
	GraphSettings MapElementGraphSettings `json:"graph_settings"`
	Status        string                  `json:"status"`
	Weight        int                     `json:"weight"`
	Zone          *MapZone                `json:"zone,omitempty"`
}

swagger:model

type MapElementGraphSettings

type MapElementGraphSettings struct {
	Width    *int64                          `json:"width"`
	Height   *int64                          `json:"height"`
	Position MapElementGraphSettingsPosition `json:"position"`
}

type MapElementGraphSettingsPosition

type MapElementGraphSettingsPosition struct {
	Top  int64 `json:"top"`
	Left int64 `json:"left"`
}

type MapFull

type MapFull struct {
	Id          int64       `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Options     MapOptions  `json:"options"`
	Layers      []*MapLayer `json:"layers"`
}

swagger:model

type MapImage

type MapImage struct {
	Id      int64  `json:"id,omitempty"`
	Image   *Image `json:"image"`
	ImageId int64  `json:"image_id"`
	Style   string `json:"style"`
}

type MapLayer

type MapLayer struct {
	Id          int64         `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Map         *Map          `json:"map"`
	MapId       int64         `json:"map_id"`
	Status      string        `json:"status"`
	Weight      int64         `json:"weight"`
	Elements    []*MapElement `json:"elements"`
}

swagger:model

type MapOptions

type MapOptions struct {
	Zoom              float64 `json:"zoom"`
	ElementStateText  bool    `json:"element_state_text"`
	ElementOptionText bool    `json:"element_option_text"`
}

type MapText

type MapText struct {
	Id    int64  `json:"id"`
	Text  string `json:"text"`
	Style string `json:"style"`
}

type MapZone

type MapZone struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type NewDevice

type NewDevice struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Status      string           `json:"status"`
	Device      *ParentDevice    `json:"device"`
	Type        string           `json:"type"`
	Node        *NewDeviceNode   `json:"node"`
	Properties  DeviceProperties `json:"properties"`
}

swagger:model

type NewDeviceAction

type NewDeviceAction struct {
	Name        string              `json:"name" valid:"MaxSize(254);Required"`
	Description string              `json:"description"`
	Device      *DeviceActionDevice `json:"device"`
	Script      *DeviceActionScript `json:"script"`
}

swagger:model

type NewDeviceNode

type NewDeviceNode struct {
	Id int64 `json:"id"`
}

type NewDeviceState

type NewDeviceState struct {
	Description string             `json:"description"`
	SystemName  string             `json:"system_name" valid:"MaxSize(254);Required"`
	Device      *DeviceStateDevice `json:"device" valid:"Required"`
}

swagger:model

type NewMap

type NewMap struct {
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Options     MapOptions `json:"options"`
}

swagger:model

type NewMapLayer

type NewMapLayer struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Map         *Map   `json:"map"`
	Status      string `json:"status"`
}

swagger:model

type ParentDevice

type ParentDevice struct {
	Id int64 `json:"id"`
}

type Prototype

type Prototype struct {
	*MapImage
	*MapText
	*MapDevice
}

swagger:model

func (Prototype) MarshalJSON

func (n Prototype) MarshalJSON() (b []byte, err error)

func (*Prototype) UnmarshalJSON

func (n *Prototype) UnmarshalJSON(data []byte) (err error)

type SortMapElement

type SortMapElement struct {
	Id     int64 `json:"id"`
	Weight int64 `json:"weight"`
}

type SortMapLayer

type SortMapLayer struct {
	Id     int64 `json:"id"`
	Weight int64 `json:"weight"`
}

type UpdateDevice

type UpdateDevice struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Status      string           `json:"status"`
	Device      *ParentDevice    `json:"device"`
	Type        string           `json:"type"`
	Node        *NewDeviceNode   `json:"node"`
	Properties  DeviceProperties `json:"properties"`
}

swagger:model

type UpdateDeviceAction

type UpdateDeviceAction struct {
	Id          int64               `json:"id"`
	Name        string              `json:"name" valid:"MaxSize(254);Required"`
	Description string              `json:"description"`
	Device      *DeviceActionDevice `json:"device"`
	Script      *DeviceActionScript `json:"script"`
}

swagger:model

type UpdateDeviceState

type UpdateDeviceState struct {
	Description string             `json:"description"`
	SystemName  string             `json:"system_name" valid:"MaxSize(254);Required"`
	Device      *DeviceStateDevice `json:"device" valid:"Required"`
}

swagger:model

type UpdateMap

type UpdateMap struct {
	Id          int64      `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Options     MapOptions `json:"options"`
}

swagger:model

type UpdateMapLayer

type UpdateMapLayer struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Map         *Map   `json:"map"`
	Status      string `json:"status"`
}

swagger:model

Jump to

Keyboard shortcuts

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