model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppContainer          = "app"
	ThingContainer        = "thing"
	DeviceContainer       = "dev"
	AttributeUpdatedByCmd = 1
	AttributeUpdatedByEvt = 2
)
View Source
const IDnil = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	ID       ID        `json:"id" storm:"id,increment"`
	Services []Service `json:"services"`
}

type App

type App struct {
	ID       ID        `json:"id" storm:"id,increment"`
	Services []Service `json:"services"`
}

type AttributeValueContainer

type AttributeValueContainer struct {
	Value     interface{}
	ValueType string
	UpdatedAt time.Time
	UpdatedBy int
}

type Bridge

type Bridge struct {
	ID       ID        `json:"id" storm:"id,increment"`
	Services []Service `json:"services"`
}

type Device

type Device struct {
	ID         ID     `json:"id" storm:"id,increment"`
	ThingId    ID     `json:"thing_id" `
	LocationId ID     `json:"location_id"`
	Alias      string `json:"alias"`
	Type       string `json:"type"`
}

type DeviceExtendedView

type DeviceExtendedView struct {
	Device
	Services      []Service `json:"services"`
	LocationAlias string    `json:"location_alias"`
}

type DeviceWithLocationView

type DeviceWithLocationView struct {
	Device
	LocationAlias string `json:"location_alias"`
}

type ID

type ID int

type Interface

type Interface struct {
	Type      string `json:"intf_t"`
	MsgType   string `json:"msg_t"`
	ValueType string `json:"val_t"`
	Version   string `json:"ver"`
}

type InterfaceFlatView

type InterfaceFlatView struct {
	ThingId            ID       `json:"thing_id"`
	ThingAddress       string   `json:"thing_address"`
	ThingTech          string   `json:"thing_tech"`
	ThingAlias         string   `json:"thing_alias"`
	ServiceId          ID       `json:"service_id"`
	ServiceName        string   `json:"service_name"`
	ServiceAlias       string   `json:"service_alias"`
	ServiceAddress     string   `json:"service_address"`
	InterfaceType      string   `json:"intf_type"`
	InterfaceMsgType   string   `json:"intf_msg_type"`
	InterfaceAddress   string   `json:"intf_address"`
	InterfaceValueType string   `json:"intf_val_type"`
	LocationId         ID       `json:"location_id"`
	LocationAlias      string   `json:"location_alias"`
	LocationType       string   `json:"location_type"`
	Groups             []string `json:"groups"`
}

type Location

type Location struct {
	ID             ID         `json:"id" storm:"id,increment,index"`
	IntegrationId  string     `json:"integr_id"`
	Type           string     `json:"type"`
	SubType        string     `json:"sub_type"`
	Alias          string     `json:"alias"`
	Address        string     `json:"address"`
	Longitude      float64    `json:"long"`
	Latitude       float64    `json:"lat"`
	Image          string     `json:"image"`
	ChildLocations []Location `json:"child_locations"`
	ParentID       ID         `json:"parent_id"`
	State          string     `json:"state"`
}

type Service

type Service struct {
	ID                  ID                                 `json:"id"  storm:"id,increment,index"`
	IntegrationId       string                             `json:"integr_id" storm:"index"`
	ParentContainerId   ID                                 `json:"container_id" storm:"index"`
	ParentContainerType string                             `json:"container_type" storm:"index"`
	Name                string                             `json:"name" storm:"index"`
	Enabled             bool                               `json:"enabled"`
	Alias               string                             `json:"alias"`
	Address             string                             `json:"address" storm:"index"`
	Groups              []string                           `json:"groups"`
	LocationId          ID                                 `json:"location_id" storm:"index"`
	Props               map[string]interface{}             `json:"props"`
	Tags                []string                           `json:"tags"`
	Interfaces          []Interface                        `json:"interfaces"`
	Attributes          map[string]AttributeValueContainer `json:"attributes"`
}

type ServiceExtendedView

type ServiceExtendedView struct {
	Service
	LocationAlias   string `json:"location_alias"`
	LocationType    string `json:"location_type"`
	LocationSubType string `json:"location_sub_type"`
}

type Thing

type Thing struct {
	ID                ID                                `json:"id" storm:"id,increment,index"`
	IntegrationId     string                            `json:"integr_id" storm:"index"`
	Address           string                            `json:"address" storm:"index"`
	Type              string                            `json:"type"`
	ProductHash       string                            `json:"product_hash"`
	Alias             string                            `json:"alias"`
	CommTechnology    string                            `json:"comm_tech" storm:"index"`
	ProductId         string                            `json:"product_id"`
	ProductName       string                            `json:"product_name"`
	ManufacturerId    string                            `json:"manufacturer_id"`
	DeviceId          string                            `json:"device_id"`
	HwVersion         string                            `json:"hw_ver"`
	SwVersion         string                            `json:"sw_ver"`
	PowerSource       string                            `json:"power_source"`
	WakeUpInterval    string                            `json:"wakeup_interval"`
	Security          string                            `json:"security"`
	Tags              []string                          `json:"tags"`
	LocationId        ID                                `json:"location_id" storm:"index"`
	PropSets          map[string]map[string]interface{} `json:"prop_set"`
	TechSpecificProps map[string]string                 `json:"tech_specific_props"`
	UpdatedAt         time.Time                         `json:"updated_at"`
}

type ThingExtendedView

type ThingExtendedView struct {
	Thing
	LocationAlias string `json:"location_alias"`
}

type ThingRegistry

type ThingRegistry struct {
	Things    []Thing
	Locations []Location
}

type ThingWithLocationView

type ThingWithLocationView struct {
	Thing
	LocationAlias string `json:"location_alias"`
}

Jump to

Keyboard shortcuts

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