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 2023 Winc link Inc. *
- 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. ******************************************************************************
Index ¶
- Constants
- Variables
- func GetAlertWays() []string
- type AlertLevel
- type AlertListStatus
- type AlertType
- type AlertWay
- type CallType
- type DataResourceType
- type DataType
- type DeviceServiceStatusType
- type DeviceStatus
- type EventType
- type InstanceType
- type IotPlatform
- type LogLevel
- type MetadataType
- type MetricsType
- type ProductNetType
- type ProductNodeType
- type ProductProtocol
- type ProductStatus
- type ResourceType
- type RuleEngineStatus
- type RuleStatus
- type SceneStatus
- type SpecsType
- type TagName
- type Trigger
- type WorkerCondition
Constants ¶
View Source
const ( Original = "original" Avg = "avg" Max = "max" Min = "min" Sum = "sum" )
View Source
const ( CloudServiceAliyunName = "阿里物联网平台" CloudServiceHuaweiName = "华为物联网平台" CloudServiceTencentName = "腾讯物联网平台" CloudServiceOneNETName = "OneNET物联网平台" CloudServiceTuyaName = "涂鸦物联网平台" CloudServiceWincLinkName = "赢创物联网平台" )
View Source
const ( ApiVersion = "v2" ApiBase = "/api/v2" )
View Source
const ( All = "all" Id = "id" Created = "created" Modified = "modified" Pushed = "pushed" Count = "count" Device = "device" DeviceId = "deviceId" DeviceName = "deviceName" Check = "check" Product = "product" ProductId = "productId" Service = "service" Command = "command" ProductName = "productName" ServiceName = "serviceName" //ResourceName = "resourceName" ResourceId = "resourceId" Start = "start" End = "end" Age = "age" Scrub = "scrub" Type = "type" Name = "name" Label = "label" Manufacturer = "manufacturer" Model = "model" ValueType = "valueType" Offset = "offset" //query string to specify the number of items to skip before starting to collect the result set. Limit = "limit" //query string to specify the numbers of items to return Labels = "labels" //query string to specify associated user-defined labels for querying a given object. More than one label may be specified via a comma-delimited list PushEvent = "ds-pushevent" //query string to specify if an event should be pushed to the EdgeX system ReturnEvent = "ds-returnevent" //query string to specify if an event should be returned from device service Search = "search" MarkCode = "markCode" //标示符 Status = "status" Exist = "exist" FuncPointId = "funcPointId" )
Constants related to defined url path names and parameters in the v2 service APIs
View Source
const ( BootTimeoutDefault = BootTimeoutSecondsDefault * 1000 BootTimeoutSecondsDefault = 30 BootRetrySecondsDefault = 1 ConfigFileName = "configuration.toml" ConfigStemCore = "hummingbird/core/" ConfigMajorVersion = "1.0/" LogDurationKey = "duration" )
View Source
const ( HourMetricsType = "hour" HalfDayMetricsType = "halfday" DayMetricsType = "day" )
性能采集监控类型
View Source
const ( //gateway JwtParsedInfo = "jwt-parsed-info" DefaultAgentReqTimeout = 10 )
View Source
const ( DebugLevel LogLevel = 0 InfoLevel = 1 WarnLevel = 2 ErrorLevel = 3 )
View Source
const ( // 驱动运行状态 RunStatusStarted = iota + 1 RunStatusStopped RunStatusStarting RunStatusStopping )
View Source
const ( StatusRead = iota + 1 StatusStop )
驱动实例日志
View Source
const ( // 驱动库操作状态 OperateStatusDefault = "default" // 默认(未安装) OperateStatusInstalling = "installing" // 安装中 OperateStatusInstalled = "installed" // 已安装 OperateStatusUninstall = "uninstall" // 未安装 )
View Source
const ( DeviceOnline = "online" DeviceOffline = "offline" )
View Source
const ( DefaultDriverBaseAddress = "localhost:-1" HostAddress = "127.0.0.1" ConfigSuffix = ".toml" ConfigKeyDriver = "driver" DriverBaseDir = "driver-data" // 驱动相关目录dir DriverLibraryDir = DriverBaseDir + "/driver-library" DriverBinDir = DriverBaseDir + "/bin" DriverRunConfigDir = DriverBaseDir + "/run-config" DriverMntDir = DriverBaseDir + "/mnt" DriverDefaultLogPath = "logs/driver.log" DockerHummingbirdRootDir = "/var/bin/hummingbird" )
View Source
const ( DriverLibTypeDefault = iota + 1 DriverLibTypeAppService )
View Source
const ( DeviceLibraryUploadTypeConfig = 2 // 驱动配置定义,key=>value 的type DriverConfigTypeInt = "int" DriverConfigTypeFloat = "float" DriverConfigTypeString = "string" DriverConfigTypeBool = "bool" DriverConfigTypeSelect = "select" DriverConfigTypeObject = "object" DriverConfigTypeArray = "array" )
View Source
const ( // service name CoreServiceName = "hummingbird-core" // docker network type NetworkModeHost = "host" NetworkModeBridge = "bridge" // docker container state ContainerRunStatusRunning = "running" ContainerRunStatusExited = "exited" )
View Source
const ( Address = "registry.cn-shanghai.aliyuncs.com" Account = "" Password = "" SaltKey = "" )
View Source
const ( ContentType = "Content-Type" ContentTypeCBOR = "application/cbor" ContentTypeJSON = "application/json" ContentTypeYAML = "application/x-yaml" ContentTypeText = "text/plain" ContentTypeXML = "application/xml" AcceptLanguage = "Accept-Language" )
Constants related to the possible content types supported by the APIs
View Source
const (
CoreServiceKey = "hummingbird-core"
)
View Source
const (
CorrelationHeader = "X-Correlation-ID" // Sets the key of the Correlation ID HTTP header
)
View Source
const (
DB_PREFIX = "hummingbird_"
)
View Source
const DefaultAdvanceConfigID = 1
默认高级配置ID
Variables ¶
View Source
var ( //物模型能力类型 Property = "property" Event = "event" Action = "action" )
View Source
var DataResources = []DataResourceType{HttpResource, MQTTResource, KafkaResource, InfluxDBResource, TDengineResource}
View Source
var (
DecideConditions = []string{">", ">=", "<", "<=", "=", "!="}
)
View Source
var LogMap = map[LogLevel]string{ DebugLevel: logger.DebugLog, InfoLevel: logger.InfoLog, WarnLevel: logger.WarnLog, ErrorLevel: logger.ErrorLog, }
Functions ¶
func GetAlertWays ¶
func GetAlertWays() []string
Types ¶
type AlertLevel ¶
type AlertLevel string
const ( Urgent AlertLevel = "紧急" Important AlertLevel = "重要" LessImportant AlertLevel = "次要" Remind AlertLevel = "提示" )
type AlertListStatus ¶
type AlertListStatus string
const ( Ignore AlertListStatus = "忽略" Treated AlertListStatus = "已处理" Untreated AlertListStatus = "未处理" )
type DataResourceType ¶
type DataResourceType string
const ( HttpResource DataResourceType = "HTTP推送" MQTTResource DataResourceType = "消息对队列MQTT" KafkaResource DataResourceType = "消息队列Kafka" InfluxDBResource DataResourceType = "InfluxDB" TDengineResource DataResourceType = "TDengine" )
type DeviceServiceStatusType ¶
type DeviceServiceStatusType int32
type DeviceStatus ¶
type DeviceStatus string
const ( DeviceStatusUnKnow DeviceStatus = "未知" DeviceStatusOnline DeviceStatus = "在线" DeviceStatusOffline DeviceStatus = "离线" DeviceStatusUnActive DeviceStatus = "未激活" DeviceStatusDisable DeviceStatus = "禁用" )
func (DeviceStatus) TransformToDriverDeviceStatus ¶
func (i DeviceStatus) TransformToDriverDeviceStatus() driverdevice.DeviceStatus
type InstanceType ¶
type InstanceType string
const ( CloudInstance InstanceType = "cloudInstanceService" DriverInstance InstanceType = "driverInstanceService" )
type IotPlatform ¶
type IotPlatform string
const ( IotPlatform_LocalIot IotPlatform = "本地" IotPlatform_CustomerIot IotPlatform = "用户自定义" //用户自定义 IotPlatform_WinCLinkIot IotPlatform = "赢创万联" //赢创万联 IotPlatform_AliIot IotPlatform = "阿里云" //阿里 IotPlatform_HuaweiIot IotPlatform = "华为云" //华为 IotPlatform_TencentIot IotPlatform = "腾讯云" //腾讯 IotPlatform_TuyaIot IotPlatform = "涂鸦云" //涂鸦 IotPlatform_OneNetIot IotPlatform = "OneNET" //中国移动 )
func TransformEdgePlatformToDbPlatform ¶
func TransformEdgePlatformToDbPlatform(platform drivercommon.IotPlatform) IotPlatform
func (IotPlatform) TransformToCloudInstancePlatform ¶
func (i IotPlatform) TransformToCloudInstancePlatform() string
func (IotPlatform) TransformToDriverDevicePlatform ¶
func (i IotPlatform) TransformToDriverDevicePlatform() drivercommon.IotPlatform
type MetadataType ¶
type MetadataType string
const ( MySQL MetadataType = "mysql" SQLite MetadataType = "sqlite" )
type MetricsType ¶
type MetricsType string
func (MetricsType) String ¶
func (m MetricsType) String() string
type ProductNetType ¶
type ProductNetType string
const ( ProductNetTypeOther ProductNetType = "其他" ProductNetTypeCellular ProductNetType = "蜂窝" ProductNetTypeWifi ProductNetType = "WIFI" ProductNetTypeEthernet ProductNetType = "以太网" ProductNetTypeNB ProductNetType = "NB" )
func (ProductNetType) TransformToDriverProductNetType ¶
func (i ProductNetType) TransformToDriverProductNetType() driverproduct.ProductNetType
type ProductNodeType ¶
type ProductNodeType string
const ( ProductNodeTypeUnKnow ProductNodeType = "其他" ProductNodeTypeGateway ProductNodeType = "网关" ProductNodeTypeDevice ProductNodeType = "直连设备" ProductNodeTypeSubDevice ProductNodeType = "网关子设备" )
func (ProductNodeType) TransformToDriverProductNodeType ¶
func (i ProductNodeType) TransformToDriverProductNodeType() driverproduct.ProductNodeType
type ProductProtocol ¶
type ProductProtocol string
const ( ProductProtocolMQTT ProductProtocol = "MQTT" ProductProtocolCoAP ProductProtocol = "CoAP" ProductProtocolLwM2M ProductProtocol = "LwM2M" ProductProtocolHttp ProductProtocol = "HTTP" ProductProtocolOther ProductProtocol = "其他" )
type ProductStatus ¶
type ProductStatus string
const ( ProductRelease ProductStatus = "已发布" ProductUnRelease ProductStatus = "未发布" )
type ResourceType ¶
type ResourceType string
const ( DriverResource ResourceType = "driver" DeviceResource ResourceType = "device" ServiceResource ResourceType = "service" OtherResource ResourceType = "other" )
type RuleEngineStatus ¶
type RuleEngineStatus string
const ( RuleEngineStart RuleEngineStatus = "running" RuleEngineStop RuleEngineStatus = "stopped" )
type RuleStatus ¶
type RuleStatus string
const ( RuleStart RuleStatus = "running" RuleStop RuleStatus = "stopped" )
type SceneStatus ¶
type SceneStatus string
const ( SceneStart SceneStatus = "running" SceneStop SceneStatus = "stopped" )
type WorkerCondition ¶
type WorkerCondition string
const ( WorkerConditionAnyone WorkerCondition = "anyone" WorkerConditionAll WorkerCondition = "all" )
Click to show internal directories.
Click to hide internal directories.