Documentation ¶
Overview ¶
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
Index ¶
- Constants
- func GetLibrarySimpleBaseConfig() string
- func GormScanWrap(value interface{}, ojb interface{}) error
- func GormScanWrapUseNumber(value interface{}, ojb interface{}) error
- func GormValueWrap(c interface{}) (driver.Value, error)
- func HmacSha1(keyStr, value string) string
- type Action
- type Actions
- type Actions2
- type AdvanceConfig
- type AlertContent
- type AlertLevel
- type AlertList
- type AlertRule
- type AlertType
- type CategoryTemplate
- type Condition
- type Conditions
- type DataResource
- type Device
- type DeviceLibrary
- func (d DeviceLibrary) ConfigBody() string
- func (dl DeviceLibrary) DefaultVersion() SupportVersion
- func (table *DeviceLibrary) Get() interface{}
- func (d DeviceLibrary) GetConfig() (DeviceLibraryConfig, error)
- func (d DeviceLibrary) GetConfigMap() (map[string]interface{}, error)
- func (table *DeviceLibrary) TableName() string
- type DeviceLibraryConfig
- type DeviceMarket
- type DeviceService
- func (d *DeviceService) BeforeCreate(tx *gorm.DB) (err error)
- func (d *DeviceService) BeforeDelete(tx *gorm.DB) (err error)
- func (d *DeviceService) Get() interface{}
- func (d *DeviceService) GetBaseAddress() string
- func (d *DeviceService) GetPort() string
- func (d *DeviceService) IsDriver() bool
- func (d *DeviceService) IsRunning() bool
- func (d *DeviceService) IsStopped() bool
- func (d *DeviceService) TableName() string
- type DeviceServiceExtendConf
- type Doc
- type DockerConfig
- type DriverClassify
- type Events
- type Filter
- type InPutParams
- type InputOutput
- type Item
- type LanguageSdk
- type MapStringInterface
- type MapStringInterfaceUseNumber
- type MapStringSliceString
- type MapStringString
- type Metrics
- type MqttAuth
- type MsgGather
- type Notify
- type OutPutParams
- type Product
- type Properties
- type ProtocolProperties
- type Protocols
- type QuickNavigation
- type Rule
- type RuleEngine
- type Scene
- type SceneLog
- type ServiceStats
- type SliceString
- type SubNotify
- type SubRule
- type SupportVersion
- type SupportVersions
- type SystemMetrics
- type ThingModelTemplate
- type Timestamps
- type TypeSpec
- type TypeSpecArray
- type TypeSpecBool
- type TypeSpecDate
- type TypeSpecEnum
- type TypeSpecIntOrFloat
- type TypeSpecStruct
- type TypeSpecText
- type Unit
- type User
Constants ¶
const ( ServiceTypeEnumService = "service" ServiceTypeEnumDriver = "driver" ServiceTypeEnumThirdPartApp = "appService" )
服务类型,服务,驱动
Variables ¶
This section is empty.
Functions ¶
func GetLibrarySimpleBaseConfig ¶
func GetLibrarySimpleBaseConfig() string
func GormScanWrap ¶
func GormScanWrap(value interface{}, ojb interface{}) error
func GormScanWrapUseNumber ¶
func GormScanWrapUseNumber(value interface{}, ojb interface{}) error
Types ¶
type Actions ¶
type Actions struct { Id string `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` ProductId string `json:"product_id" gorm:"type:string;size:255;comment:产品ID"` Code string `json:"code" gorm:"type:string;size:255;comment:标识符"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Description string `json:"description" gorm:"type:text;comment:描述"` Require bool `json:"require" gorm:"comment:是否必须"` CallType constants.CallType `json:"call_type" gorm:"type:string;size:50;comment:调用方式"` InputParams InPutParams `json:"input_params" gorm:"type:text;comment:输入参数"` // 输入参数 OutputParams OutPutParams `json:"output_params" gorm:"type:text;comment:输入参数"` // 输出参数 Tag string `json:"tag" gorm:"type:string;size:50;comment:标签"` System bool `json:"system" gorm:"comment:系统内置"` Timestamps }
type AdvanceConfig ¶
type AdvanceConfig struct { ID int `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` LogLevel constants.LogLevel `gorm:"default:1;comment:日志等级"` // 日志级别 默认为INFO PersistStorage bool `gorm:"default:0;comment:存储开关"` StorageHour int32 `gorm:"default:24;comment:存储时长"` }
func (*AdvanceConfig) Get ¶
func (table *AdvanceConfig) Get() interface{}
func (*AdvanceConfig) TableName ¶
func (table *AdvanceConfig) TableName() string
type AlertContent ¶
type AlertContent struct { ServiceName string `json:"name"` // 服务名 Type AlertType `json:"type" binding:"oneof=1 2"` // 告警类型 Level AlertLevel `json:"level" binding:"oneof=1 2 3"` // 告警级别 T int64 `json:"time"` // 告警时间 Content string `json:"content"` // 告警内容 }
func (*AlertContent) Get ¶
func (table *AlertContent) Get() interface{}
func (*AlertContent) TableName ¶
func (table *AlertContent) TableName() string
type AlertLevel ¶
type AlertLevel int
type AlertList ¶
type AlertList struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` AlertRuleId string `gorm:"type:string;size:255;comment:告警记录ID"` TriggerTime int64 `gorm:"comment:触发时间"` AlertResult MapStringInterface `json:"alert_result" gorm:"type:string;size:255;comment:告警内容"` AlertRule AlertRule `gorm:"foreignKey:AlertRuleId"` Status constants.AlertListStatus `json:"status" gorm:"type:string;size:50;comment:状态"` TreatedTime int64 `gorm:"comment:处理时间"` Message string `gorm:"type:text;comment:处理意见"` IsSend bool `gorm:"comment:是否发送通知"` }
type AlertRule ¶
type AlertRule struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey"` Name string DeviceId string `gorm:"index"` AlertType constants.AlertType //告警类型 AlertLevel constants.AlertLevel //告警级别 Status constants.RuleStatus //状态 启动或者禁用 Condition constants.WorkerCondition //执行条件 SubRule SubRule Notify Notify SilenceTime int64 //静默时间 Description string }
func (*AlertRule) EkuiperRule ¶
type CategoryTemplate ¶
type CategoryTemplate struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` CategoryKey string `json:"category_key" gorm:"type:string;size:255;comment:品类标识"` CategoryName string `json:"category_name" gorm:"type:string;size:255;comment:品类名字"` Scene string `json:"scene" gorm:"type:string;size:255;comment:场景"` }
func (*CategoryTemplate) Get ¶
func (d *CategoryTemplate) Get() interface{}
func (*CategoryTemplate) TableName ¶
func (d *CategoryTemplate) TableName() string
type Condition ¶
type Condition struct { ConditionType string `json:"condition_type"` Option MapStringString `json:"option"` }
type Conditions ¶
type Conditions []Condition
func (*Conditions) Scan ¶
func (c *Conditions) Scan(value interface{}) error
type DataResource ¶
type DataResource struct { Timestamps `gorm:"embedded"` Id string `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Type constants.DataResourceType `json:"type" gorm:"type:string;size:50;comment:类型"` Health bool `json:"health" gorm:"comment:验证"` Option MapStringInterface `json:"option" gorm:"type:text;comment:资源内容"` }
func (*DataResource) Get ¶
func (d *DataResource) Get() interface{}
func (*DataResource) TableName ¶
func (d *DataResource) TableName() string
type Device ¶
type Device struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` CloudDeviceId string `gorm:"type:string;size:255;comment:云设备ID"` CloudProductId string `gorm:"type:string;size:255;comment:云产品ID"` CloudInstanceId string `gorm:"index;type:string;size:255;comment:云实例ID"` DriveInstanceId string `gorm:"index;type:string;size:255;comment:驱动实例ID"` Name string `gorm:"type:string;size:255;comment:名字"` Status constants.DeviceStatus `gorm:"type:string;size:50;comment:设备状态"` Description string `gorm:"type:text;comment:描述"` ProductId string `gorm:"type:string;size:255;comment:产品ID"` Secret string `gorm:"type:string;size:255;comment:密钥"` Platform constants.IotPlatform `gorm:"type:string;size:50;comment:平台名称"` InstallLocation string `gorm:"type:string;size:255;comment:安装地址"` LastSyncTime int64 `gorm:"comment:最后一次同步时间"` LastOnlineTime int64 `gorm:"comment:最后一次在线时间"` Product Product `gorm:"foreignKey:ProductId"` }
func (*Device) TransformToDriverDevice ¶
func (table *Device) TransformToDriverDevice() *driverdevice.Device
type DeviceLibrary ¶
type DeviceLibrary struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` Description string `gorm:"type:text;comment:描述"` Protocol string `gorm:"type:string;size:255;comment:驱动协议"` Version string `gorm:"type:string;size:255;comment:当前安装版本"` ContainerName string `gorm:"type:string;size:255;comment:容器名字"` DockerConfigId string `gorm:"type:string;size:255;comment:镜像仓库配置表id"` DockerRepoName string `gorm:"type:string;size:255;comment:镜像名称"` DockerImageId string `gorm:"type:string;size:255;comment:镜像ID"` SupportVersions SupportVersions `gorm:"type:text;not null;comment:可用版本"` IsInternal bool `gorm:"default:0;not null;comment:是否内置,云端内置驱动"` Language string `gorm:"type:string;size:255;comment:代码语言"` DeviceMarket OperateStatus string `gorm:"-"` }
驱动库,驱动市场
func (DeviceLibrary) ConfigBody ¶
func (d DeviceLibrary) ConfigBody() string
func (DeviceLibrary) DefaultVersion ¶
func (dl DeviceLibrary) DefaultVersion() SupportVersion
func (*DeviceLibrary) Get ¶
func (table *DeviceLibrary) Get() interface{}
func (DeviceLibrary) GetConfig ¶
func (d DeviceLibrary) GetConfig() (DeviceLibraryConfig, error)
func (DeviceLibrary) GetConfigMap ¶
func (d DeviceLibrary) GetConfigMap() (map[string]interface{}, error)
func (*DeviceLibrary) TableName ¶
func (table *DeviceLibrary) TableName() string
type DeviceLibraryConfig ¶
type DeviceLibraryConfig struct { DeviceServer map[string][]struct { Name string `json:"name"` Display string `json:"display"` Type string `json:"type"` // type 支持 int、string、float、bool、select、object、array DefaultValue string `json:"defaultValue"` Options interface{} `json:"options"` } `json:"deviceServer"` DeviceProtocols interface{} `json:"deviceProtocols"` DeviceDpAttrs []interface{} `json:"deviceDpAttrs"` }
type DeviceMarket ¶
type DeviceService ¶
type DeviceService struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` BaseAddress string `gorm:"type:string;size:255;comment:地址"` DeviceLibraryId string `gorm:"uniqueIndex;type:string;size:255;comment:驱动ID"` Config MapStringInterface `gorm:"type:string;size:255;comment:配置"` DockerContainerId string `gorm:"type:string;size:255;comment:docker容器ID"` ExpertMode bool `gorm:"comment:扩展模式"` ExpertModeContent string `gorm:"comment:扩展内容"` DockerParamsSwitch bool `gorm:"comment:docker启动参数开关"` DockerParams string `gorm:"type:text;comment:docker启动参数"` ContainerName string `gorm:"type:string;size:255;comment:容器名字"` LogLevel constants.LogLevel `gorm:"default:1;comment:日志等级"` DriverType int `gorm:"default:1;not null;comment:驱动类别,1:驱动,2:三方应用"` RunStatus int `gorm:"-"` ImageExist bool `gorm:"-"` Platform constants.IotPlatform }
DeviceService and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceService Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.
func (*DeviceService) BeforeCreate ¶
func (d *DeviceService) BeforeCreate(tx *gorm.DB) (err error)
func (*DeviceService) BeforeDelete ¶
func (d *DeviceService) BeforeDelete(tx *gorm.DB) (err error)
func (*DeviceService) Get ¶
func (d *DeviceService) Get() interface{}
func (*DeviceService) GetBaseAddress ¶
func (d *DeviceService) GetBaseAddress() string
func (*DeviceService) GetPort ¶
func (d *DeviceService) GetPort() string
func (*DeviceService) IsDriver ¶
func (d *DeviceService) IsDriver() bool
func (*DeviceService) IsRunning ¶
func (d *DeviceService) IsRunning() bool
func (*DeviceService) IsStopped ¶
func (d *DeviceService) IsStopped() bool
func (*DeviceService) TableName ¶
func (d *DeviceService) TableName() string
type DeviceServiceExtendConf ¶
type Doc ¶
type Doc struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` Sort int `gorm:"type:int;size:8;comment:排序"` JumpLink string `gorm:"type:string;size:255;comment:跳转地址"` }
type DockerConfig ¶
type DockerConfig struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Address string `gorm:"type:string;size:255;comment:地址"` Account string `gorm:"type:string;size:255;comment:用户名"` Password string `gorm:"type:string;size:255;comment:密码"` SaltKey string `gorm:"type:string;size:255;comment:盐值"` }
驱动镜像配置表,alias MirrorConfig
func (*DockerConfig) Get ¶
func (table *DockerConfig) Get() interface{}
func (*DockerConfig) TableName ¶
func (table *DockerConfig) TableName() string
type DriverClassify ¶
type DriverClassify struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` }
驱动市场分类
func (*DriverClassify) Get ¶
func (table *DriverClassify) Get() interface{}
func (*DriverClassify) TableName ¶
func (table *DriverClassify) TableName() string
type Events ¶
type Events struct { Id string `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` ProductId string `json:"product_id" gorm:"type:string;size:255;comment:产品ID"` EventType string `json:"event_type" gorm:"type:string;size:255;comment:事件类型"` Code string `json:"code" gorm:"type:string;size:255;comment:标识符"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Description string `json:"description" gorm:"type:text;comment:描述"` Require bool `json:"require" gorm:"comment:是否必须"` OutputParams OutPutParams `json:"output_params" gorm:"type:text;comment:输入参数"` Tag string `json:"tag" gorm:"type:string;size:50;comment:标签"` System bool `json:"system" gorm:"comment:系统内置"` Timestamps }
type Filter ¶
type Filter struct { MessageSource string `json:"message_source" gorm:"type:string;size:255;comment:消息源"` SelectName string `json:"select_name" gorm:"type:string;size:255;comment:选择字段"` Condition string `json:"condition" gorm:"type:string;size:255;comment:条件"` Sql string `json:"sql" gorm:"type:string;size:255;comment:sql"` }
type InPutParams ¶
type InPutParams []InputOutput
func (*InPutParams) Scan ¶
func (c *InPutParams) Scan(value interface{}) error
type InputOutput ¶
type LanguageSdk ¶
type LanguageSdk struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Icon string `json:"icon" gorm:"type:text;comment:图标"` Addr string `json:"addr" gorm:"type:string;size:255;comment:地址"` Description string `json:"description" gorm:"type:text;comment:描述"` Sort int `gorm:"type:int;size:8;comment:排序"` }
func (*LanguageSdk) Get ¶
func (d *LanguageSdk) Get() interface{}
func (*LanguageSdk) TableName ¶
func (d *LanguageSdk) TableName() string
type MapStringInterface ¶
type MapStringInterface map[string]interface{}
func (*MapStringInterface) Scan ¶
func (c *MapStringInterface) Scan(value interface{}) error
type MapStringInterfaceUseNumber ¶
type MapStringInterfaceUseNumber map[string]interface{}
func (*MapStringInterfaceUseNumber) Scan ¶
func (c *MapStringInterfaceUseNumber) Scan(value interface{}) error
type MapStringSliceString ¶
func (*MapStringSliceString) Scan ¶
func (c *MapStringSliceString) Scan(value interface{}) error
type MapStringString ¶
func (*MapStringString) Scan ¶
func (c *MapStringString) Scan(value interface{}) error
type Metrics ¶
type MqttAuth ¶
type MqttAuth struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` ResourceId string `gorm:"type:string;size:255;comment:资源ID"` ResourceType constants.ResourceType `gorm:"type:string;size:255;comment:资源类型"` ClientId string `gorm:"uniqueIndex;size:255;comment:客户端ID"` UserName string `gorm:"type:string;size:255;comment:用户名"` Password string `gorm:"type:string;size:255;comment:密码"` }
type MsgGather ¶
type MsgGather struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Date string `json:"date" gorm:"type:string;size:255;comment:日期"` Count int `json:"count" gorm:"comment:数量"` }
type OutPutParams ¶
type OutPutParams []InputOutput
func (*OutPutParams) Scan ¶
func (c *OutPutParams) Scan(value interface{}) error
type Product ¶
type Product struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` Key string `gorm:"type:string;size:255;comment:产品标识"` CloudProductId string `gorm:"type:string;size:255;comment:云产品ID"` CloudInstanceId string `gorm:"index;type:string;size:255;comment:云实例ID"` Platform constants.IotPlatform `gorm:"type:string;size:255;comment:平台"` Protocol string `gorm:"type:string;size:255;comment:协议"` NodeType constants.ProductNodeType `gorm:"type:string;size:255;comment:节点类型"` NetType constants.ProductNetType `gorm:"type:string;size:255;comment:网络类型"` DataFormat string `gorm:"type:string;size:255;comment:数据类型"` LastSyncTime int64 `gorm:"comment:最后一次同步时间"` Factory string `gorm:"type:string;size:255;comment:工厂名称"` Description string `gorm:"type:text;comment:描述"` Status constants.ProductStatus `gorm:"type:string;size:255;comment:产品状态"` Extra MapStringString `gorm:"type:string;size:255;comment:扩展字段"` Properties []Properties `gorm:"foreignKey:ProductId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` // 物模型的属性列表 Events []Events `gorm:"foreignKey:ProductId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` // 物模型的事件列表 Actions []Actions `gorm:"foreignKey:ProductId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` // 物模型的动作列表 }
func (*Product) TransformToDriverProduct ¶
func (d *Product) TransformToDriverProduct() *driverproduct.Product
type Properties ¶
type Properties struct { Id string `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` ProductId string `json:"product_id" gorm:"type:string;size:255;comment:产品ID"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Code string `json:"code" gorm:"type:string;size:255;comment:标识符"` AccessMode string `json:"access_mode" gorm:"type:string;size:50;comment:读写模型"` Require bool `json:"require" gorm:"comment:是否必须"` TypeSpec TypeSpec `json:"type_spec" gorm:"type:text;comment:属性物模型详情"` Description string `json:"description" gorm:"type:text;comment:描述"` Tag string `json:"tag" gorm:"type:string;size:50;comment:标签"` System bool `json:"system" gorm:"comment:系统内置"` Timestamps }
func (*Properties) Get ¶
func (p *Properties) Get() interface{}
func (*Properties) TableName ¶
func (p *Properties) TableName() string
type ProtocolProperties ¶
ProtocolProperties contains the device connection information in key/value pair
type Protocols ¶
type Protocols map[string]ProtocolProperties
type QuickNavigation ¶
type QuickNavigation struct {}
func (*QuickNavigation) Get ¶
func (d *QuickNavigation) Get() interface{}
func (*QuickNavigation) TableName ¶
func (d *QuickNavigation) TableName() string
type Rule ¶
type Rule struct { Trigger constants.Trigger `json:"trigger"` //触发方式 ProductId string `json:"product_id"` DeviceId string `json:"device_id"` Option MapStringString `json:"option"` }
type RuleEngine ¶
type RuleEngine struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `gorm:"type:string;size:255;comment:名字"` Description string `gorm:"type:text;comment:描述"` Status constants.RuleEngineStatus `gorm:"type:string;size:50;comment:状态"` Filter Filter DataResourceId string `gorm:"type:string;size:255;comment:资源ID"` DataResource DataResource `gorm:"foreignKey:DataResourceId"` }
func (*RuleEngine) Get ¶
func (d *RuleEngine) Get() interface{}
func (*RuleEngine) TableName ¶
func (d *RuleEngine) TableName() string
type Scene ¶
type Scene struct { Timestamps `gorm:"embedded"` Id string `json:"id" gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` Description string `json:"description" gorm:"type:text;comment:描述"` Status constants.SceneStatus `json:"status" gorm:"type:string;size:50;comment:状态"` Conditions Conditions `json:"conditions" gorm:"type:text;comment:条件"` Actions Actions2 `json:"actions" gorm:"type:text;comment:动作"` }
func (*Scene) ToRuntimeJob ¶
func (d *Scene) ToRuntimeJob() (schedule *jobs.JobSchedule, err error)
type SceneLog ¶
type SceneLog struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` SceneId string `gorm:"index;type:string;size:255;comment:场景ID" json:"scene_id"` Name string `json:"name" gorm:"type:string;size:255;comment:名字"` ExecRes string `json:"exec_res" gorm:"type:text;comment:执行结果"` }
type ServiceStats ¶
type ServiceStats struct { Id string `gorm:"column:id" json:"id"` // 服务标识 Name string `gorm:"column:name;pk" json:"name"` // 容器名称 LogPath string `json:"log_path"` // 日志地址, 宿主主机日志路径 ServiceType string `json:"service_type"` // 服务类型,服务,驱动,应用 Healthy bool `json:"healthy"` // 状态, docker.inspect.State.Running Created string `json:"created"` // 创建时间, docker.inspect.Created Started string `json:"started"` // 启动时间, docker.inspect.State.StartedAt }
func (*ServiceStats) Get ¶
func (s *ServiceStats) Get() interface{}
func (*ServiceStats) TableName ¶
func (s *ServiceStats) TableName() string
func (ServiceStats) ToJSON ¶
func (s ServiceStats) ToJSON() string
type SliceString ¶
type SliceString []string
func (*SliceString) Scan ¶
func (c *SliceString) Scan(value interface{}) error
type SubNotify ¶
type SubNotify struct { Name constants.AlertWay `json:"name"` //告警方式 Option MapStringString `json:"option"` StartEffectTime string `json:"start_effect_time"` //生效开始时间 EndEffectTime string `json:"end_effect_time"` //生效结束时间 }
type SupportVersion ¶
type SupportVersions ¶
type SupportVersions []SupportVersion
func (*SupportVersions) Scan ¶
func (c *SupportVersions) Scan(value interface{}) error
type SystemMetrics ¶
type SystemMetrics struct { ID int64 `gorm:"column:id;pk;autoIncrement"` Data string `gorm:"column:data"` Timestamp int64 `gorm:"column:timestamp"` // 时间戳 }
func (*SystemMetrics) Get ¶
func (table *SystemMetrics) Get() interface{}
func (*SystemMetrics) TableName ¶
func (table *SystemMetrics) TableName() string
type ThingModelTemplate ¶
type ThingModelTemplate struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` CategoryKey string `gorm:"type:string;size:255;comment:品类key"` CategoryName string `gorm:"type:string;size:255;comment:品类名字"` ThingModelJSON string `gorm:"type:text;comment:物模型信息"` }
func (*ThingModelTemplate) Get ¶
func (d *ThingModelTemplate) Get() interface{}
func (*ThingModelTemplate) TableName ¶
func (d *ThingModelTemplate) TableName() string
type Timestamps ¶
type TypeSpec ¶
type TypeSpec struct { Type constants.SpecsType `json:"type,omitempty"` Specs string `json:"specs,omitempty"` }
TypeSpec 物模型的属性、事件、动作的基础信息字段
type TypeSpecArray ¶
func (*TypeSpecArray) TransformTostring ¶
func (t *TypeSpecArray) TransformTostring() string
type TypeSpecBool ¶
func (*TypeSpecBool) TransformTostring ¶
func (t *TypeSpecBool) TransformTostring() string
type TypeSpecDate ¶
type TypeSpecDate struct { }
func (*TypeSpecDate) TransformTostring ¶
func (t *TypeSpecDate) TransformTostring() string
type TypeSpecEnum ¶
func (*TypeSpecEnum) TransformTostring ¶
func (t *TypeSpecEnum) TransformTostring() string
type TypeSpecIntOrFloat ¶
type TypeSpecIntOrFloat struct { Min string `json:"min,omitempty"` Max string `json:"max,omitempty"` Step string `json:"step,omitempty"` Unit string `json:"unit,omitempty"` UnitName string `json:"unitName,omitempty"` }
func (*TypeSpecIntOrFloat) TransformTostring ¶
func (t *TypeSpecIntOrFloat) TransformTostring() string
type TypeSpecStruct ¶
type TypeSpecStruct struct { Code string `json:"code"` Name string `json:"name"` DataType TypeSpec `json:"data_type"` }
func (*TypeSpecStruct) TransformTostring ¶
func (t *TypeSpecStruct) TransformTostring() string
type TypeSpecText ¶
type TypeSpecText struct {
Length string `json:"length,omitempty"`
}
func (*TypeSpecText) TransformTostring ¶
func (t *TypeSpecText) TransformTostring() string
type Unit ¶
type Unit struct { Timestamps `gorm:"embedded"` Id string `gorm:"id;primaryKey;not null;type:string;size:255;comment:主键"` Symbol string `json:"symbol" gorm:"type:string;size:255;comment:符号"` UnitName string `json:"unit_name" gorm:"type:string;size:255;comment:单位名字"` }
type User ¶
type User struct { Username string `gorm:"index;type:string;size:255;comment:名字"` Password string `gorm:"type:string;size:255;comment:密码"` Lang string `gorm:"type:string;size:50;comment:语言"` GatewayKey string `gorm:"type:string;size:255;comment:密钥"` OpenAPIKey string `gorm:"type:string;size:255;comment:密钥"` }
Source Files ¶
- ability.go
- advanceconfig.go
- alert.go
- alertcentre.go
- categorytemplate.go
- common.go
- dataresoure.go
- device.go
- devicelibrary.go
- deviceservice.go
- dockerconfig.go
- docs.go
- driverclassify.go
- languagesdk.go
- metrics.go
- mqttauth.go
- msggather.go
- product.go
- quicknavigation.go
- ruleengine.go
- scene.go
- scenelog.go
- servicestats.go
- thingmodeltemplate.go
- timestamps.go
- unit.go
- user.go