dtos

package
v0.0.0-...-620b1b6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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. ******************************************************************************

******************************************************************************

  • 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. ******************************************************************************

******************************************************************************

  • 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. ******************************************************************************

******************************************************************************

  • 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

View Source
const (
	PageDefault        = 1
	PageSizeDefault    = 10
	PageSizeMaxDefault = 1000
)
View Source
const (
	DevicesFilename = "Devices"
)

Variables

This section is empty.

Functions

func ApiParamsArrayToString

func ApiParamsArrayToString(arr []string) string

func ApiParamsStringToArray

func ApiParamsStringToArray(str string) []string

func CorrectionPageParam

func CorrectionPageParam(query *BaseSearchConditionQuery)

func FromDeviceLibraryRpcToModel

func FromDeviceLibraryRpcToModel(p *DeviceLibraryAddRequest) models.DeviceLibrary

func FromYamlStrToMap

func FromYamlStrToMap(yamlStr string) (m map[string]interface{}, err error)

func GetLibrarySimpleBaseConfig

func GetLibrarySimpleBaseConfig() string

func GetModelPropertyEventActionByThingModelTemplate

func GetModelPropertyEventActionByThingModelTemplate(thingModelJSON string) (properties []models.Properties, events []models.Events, actions []models.Actions)

func ReplaceDataResourceModelFields

func ReplaceDataResourceModelFields(ds *models.DataResource, patch UpdateDataResource)

func ReplaceDeviceLibraryModelFieldsWithDTO

func ReplaceDeviceLibraryModelFieldsWithDTO(deviceLibrary *models.DeviceLibrary, patch UpdateDeviceLibrary)

func ReplaceDeviceModelFields

func ReplaceDeviceModelFields(ds *models.Device, patch DeviceUpdateRequest)

func ReplaceDeviceServiceModelFieldsWithDTO

func ReplaceDeviceServiceModelFieldsWithDTO(ds *models.DeviceService, patch DeviceServiceUpdateRequest)

func ReplaceDockerConfigModelFieldsWithDTO

func ReplaceDockerConfigModelFieldsWithDTO(ds *models.DockerConfig, patch DockerConfigUpdateRequest)

func ReplaceRuleEngineModelFields

func ReplaceRuleEngineModelFields(ds *models.RuleEngine, patch RuleEngineUpdateRequest)

func ReplaceRuleFields

func ReplaceRuleFields(ds *models.AlertRule, patch RuleFieldUpdate)

func ReplaceRuleModelFields

func ReplaceRuleModelFields(ds *models.AlertRule, patch RuleUpdateRequest)

func ReplaceSceneModelFields

func ReplaceSceneModelFields(scene *models.Scene, req SceneUpdateRequest)

Types

type Action

type Action struct {
	ProductID   string `json:"product_id"`
	ProductName string `json:"product_name"`
	DeviceID    string `json:"device_id"`
	DeviceName  string `json:"device_name"`
	Code        string `json:"code"`
	DataType    string `json:"data_type"`
	Value       string `json:"value"`
}

type Actions

type Actions struct {
	Rest     map[string]interface{} `json:"rest,omitempty"`
	MQTT     map[string]interface{} `json:"mqtt,omitempty"`
	Kafka    map[string]interface{} `json:"kafka,omitempty"`
	Zmq      map[string]interface{} `json:"zmq,omitempty"`
	Redis    map[string]interface{} `json:"redis,omitempty"`
	Influx   map[string]interface{} `json:"influx,omitempty"`
	Tdengine map[string]interface{} `json:"tdengine,omitempty"`
}

func GetRuleAlertEkuiperActions

func GetRuleAlertEkuiperActions(actionUrl string) []Actions

func GetRuleSceneEkuiperActions

func GetRuleSceneEkuiperActions(actionUrl string) []Actions

type AddDataResourceReq

type AddDataResourceReq struct {
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Option map[string]interface{} `json:"option"`
}

type AddMqttAuthInfoRequest

type AddMqttAuthInfoRequest struct {
	Id           string `json:"id"`
	ClientId     string `json:"client_id"`
	UserName     string `json:"username"`
	Password     string `json:"password"`
	ResourceId   string `json:"resource_id"`
	ResourceType string `json:"resource_type"`
}

type AgentRequest

type AgentRequest struct {
	Cmd            string   `json:"cmd"`
	Args           []string `json:"args"`
	TimeoutSeconds int      `json:"timeout_seconds"`
}

type AgentResponse

type AgentResponse struct {
	Operation    string `json:"operation"`
	Service      string `json:"service"`
	Executor     string `json:"executor"`
	Success      bool   `json:"success"`
	ErrorMessage string `json:"errorMessage"`
}

type Alert

type Alert struct {
	Count      int    `json:"count"`
	AlertLevel string `json:"alert_level"`
}

type AlertAddRequest

type AlertAddRequest struct {
	DeviceId    string `json:"device_id"`
	TriggerTime int64  `json:"trigger_time"` //触发时间
	RuleId      string `json:"rule_id"`
	Content     string `json:"content"`
}

type AlertPlateQueryResponse

type AlertPlateQueryResponse struct {
	Count      int                  `json:"count"`
	AlertLevel constants.AlertLevel `json:"alert_level"`
}

type AlertRuleSearchQueryRequest

type AlertRuleSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	Status                   string `schema:"status,omitempty"`
	Msg                      string `schema:"msg,omitempty"`
}

type AlertRuleSearchQueryResponse

type AlertRuleSearchQueryResponse struct {
	Id          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	AlertType   constants.AlertType  `json:"alert_type"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	Created     int64                `json:"created"`
	Status      constants.RuleStatus `json:"status"`
	SubRule     []SubRule            `json:"sub_rule"`
}

func RuleSearchQueryResponseFromModel

func RuleSearchQueryResponseFromModel(p models.AlertRule) AlertRuleSearchQueryResponse

type AlertSearchQueryRequest

type AlertSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	AlertLevel               string `schema:"alert_level,omitempty"`
	Status                   string `schema:"status,omitempty"`
	TriggerStartTime         int    `schema:"trigger_start_time,omitempty"`
	TriggerEndTime           int    `schema:"trigger_end_time,omitempty"`
}

type AlertSearchQueryResponse

type AlertSearchQueryResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//Description string               `json:"description"`
	AlertResult string               `json:"alert_result"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	TriggerTime int64                `json:"trigger_time"`
	TreatedTime int64                `json:"treated_time"`
	Status      string               `json:"status"`
	Message     string               `json:"message"`
	IsSend      bool                 `json:"is_send"`
}

type AlertTreatedRequest

type AlertTreatedRequest struct {
	Id      string `json:"id"`
	Message string `json:"message"`
}

type ApiOrderBy

type ApiOrderBy struct {
	Key    string
	IsDesc bool
}

func ApiParamsStringToOrderBy

func ApiParamsStringToOrderBy(str string) []ApiOrderBy

type AppServiceConfig

type AppServiceConfig struct {
	Log struct {
		LogLevel string
		LogPath  string
	}
	Tedge struct {
		Host string
		Port int32
	}
	Server struct {
		ID   string
		Name string
		Host string
		Port int32
	}
	//应用私有配置
	CustomConfig map[string]interface{}
}

type AuthorizationInfo

type AuthorizationInfo struct {
	AK         string
	SK         string
	Regions    string
	ProjectId  string
	InstanceId string
	Endpoint   string
	MqttHost   string
	MqttPort   string
}

type BaseSearchConditionQuery

type BaseSearchConditionQuery struct {
	Page     int    `schema:"page,omitempty" form:"page"`
	PageSize int    `schema:"pageSize,omitempty" form:"pageSize" json:"pageSize"`
	Id       string `schema:"id,omitempty" form:"id"`
	Ids      string `schema:"ids,omitempty" form:"ids"`
	LikeId   string `schema:"likeId,omitempty" form:"likeId"`
	Name     string `schema:"name,omitempty" form:"name"`
	NameLike string `schema:"nameLike,omitempty" form:"nameLike"`
	IsAll    bool   `schema:"isAll,omitempty" form:"isAll"`
	OrderBy  string `schema:"orderBy,omitempty" form:"orderBy"`
}

func (BaseSearchConditionQuery) GetPage

func (req BaseSearchConditionQuery) GetPage() (int, int)

type BatchData

type BatchData struct {
	Properties map[string]BatchProperty `json:"properties"`
	Events     map[string]BatchEvent    `json:"events"`
}

type BatchEvent

type BatchEvent struct {
	//EventTime    int64                  `json:"eventTime"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

type BatchProperty

type BatchProperty struct {
	Value interface{} `json:"value"`
}

type CallbackHandler

type CallbackHandler func(context.Context, CallbackMessage)

type CallbackMessage

type CallbackMessage struct {
	Error error
}

type CategoryTemplateRequest

type CategoryTemplateRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	CategoryName             string `schema:"category_name"`
	Scene                    string `schema:"scene"`
}

type CategoryTemplateResponse

type CategoryTemplateResponse struct {
	Id           string `json:"id"`
	CategoryName string `json:"category_name"` //品类名称
	CategoryKey  string `json:"category_key"`
	Scene        string `json:"scene"` //所属场景
}

type CategoryTemplateSyncRequest

type CategoryTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type ClientInfo

type ClientInfo struct {
	Address string
	// 是否启用tls
	UseTLS bool
	// ca cert
	CertFilePath string
	// mqtt clientId
	ClientId string
	// mqtt username
	Username string
	// mqtt password
	Password string
}

ClientInfo provides the host and port of another service in tedge.

type CloudInstanceConfig

type CloudInstanceConfig struct {
	Logger        CloudInstanceLogConfig
	Clients       map[string]ClientInfo
	Authorization AuthorizationInfo
	Service       ServiceInfo
}

type CloudInstanceLogConfig

type CloudInstanceLogConfig struct {
	FileName  string
	LogSwitch bool
	LogFilter []string
}

type Condition

type Condition struct {
	ConditionType string            `json:"condition_type"`
	Option        map[string]string `json:"option"`
}

type Configuration

type Configuration struct {
	DbType       string
	Host         string
	Port         string
	Timeout      int
	DatabaseName string
	Username     string
	Password     string
	BatchSize    int
	Dsn          string
	// 添加sqlite数据库存储地址
	DataSource string
	// 添加tqlite集群地址
	Cluster []string
}

type ConnectHandler

type ConnectHandler func(ctx context.Context)

type CosCategoryTemplateResponse

type CosCategoryTemplateResponse struct {
	CategoryName string `json:"category_name"`
	CategoryKey  string `json:"category_key"`
	Scene        string `json:"scene"`
}

type CosDocTemplateResponse

type CosDocTemplateResponse struct {
	Name     string `json:"Name"`
	Sort     int    `json:"Sort"`
	JumpLink string `json:"JumpLink"`
}

type CosQuickNavigationTemplateResponse

type CosQuickNavigationTemplateResponse struct {
	Name     string `json:"Name"`
	Sort     int    `json:"Sort"`
	Icon     string `json:"Icon"`
	JumpLink string `json:"JumpLink"`
}

type CosThingModelTemplateResponse

type CosThingModelTemplateResponse struct {
	CategoryName   string `json:"category_name"`
	CategoryKey    string `json:"category_key"`
	ThingModelJSON string `json:"thing_model_json"`
}

type CosUnitTemplateResponse

type CosUnitTemplateResponse struct {
	UnitName string `json:"Name"`
	Symbol   string `json:"Symbol"`
}

type CpuStats

type CpuStats struct {
	CpuUsage       CpuUsage `json:"cpu_usage"`
	SystemCpuUsage int64    `json:"system_cpu_usage"`
	OnlineCpus     int64    `json:"online_cpus"`
}

type CpuUsage

type CpuUsage struct {
	PercpuUsage []int64 `json:"percpu_usage"`
	TotalUsage  int64   `json:"total_usage"`
}

type CreateRule

type CreateRule struct {
	Triggered bool      `json:"triggered"`
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Sql       string    `json:"sql"`
	Actions   []Actions `json:"actions"`
}

func (CreateRule) BuildCreateRuleParam

func (b CreateRule) BuildCreateRuleParam(actions []Actions, ruleId, sql string) CreateRule

type DataResourceInfo

type DataResourceInfo struct {
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Option map[string]interface{} `json:"option"`
}

type DataResourceSearchQueryRequest

type DataResourceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Type                     string `schema:"type,omitempty"`
	Health                   string `schema:"health,omitempty"`
}

type DeviceAddRequest

type DeviceAddRequest struct {
	DeviceId         string                `json:"device_id"`
	Name             string                `json:"name"`
	ProductId        string                `json:"product_id"`
	Description      string                `json:"description"`
	Platform         constants.IotPlatform `json:"platform"`
	DriverInstanceId string                `json:"driver_instance_id"`
}

type DeviceAuthInfoResponse

type DeviceAuthInfoResponse struct {
	ClientId string `json:"clientId"`
	UserName string `json:"username"`
	Password string `json:"password"`
	Host     string `json:"mqttHostUrl"`
	Port     int    `json:"port"`
}

func DeviceAuthInfoResponseFromModel

func DeviceAuthInfoResponseFromModel(p models.MqttAuth) DeviceAuthInfoResponse

type DeviceBatchDelete

type DeviceBatchDelete struct {
	DeviceIds []string `json:"device_ids"`
}

type DeviceBatchReport

type DeviceBatchReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	Time    int64  `json:"time"`
	Sys     struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data BatchData `json:"data"`
}

type DeviceDeleteCallBack

type DeviceDeleteCallBack struct {
	Id              string `json:"id"`
	DriveInstanceId string `json:"drive_instance_id"`
}

type DeviceEffectivePropertyDataReq

type DeviceEffectivePropertyDataReq struct {
	DeviceId string   `json:"deviceId"`
	Codes    []string `json:"codes"`
}

type DeviceEffectivePropertyDataResponse

type DeviceEffectivePropertyDataResponse struct {
	Data []EffectivePropertyData `json:"propertyInfo"`
}

type DeviceExecRes

type DeviceExecRes struct {
	Result  bool   `json:"result"`
	Message string `json:"message"`
}

func (*DeviceExecRes) ToString

func (d *DeviceExecRes) ToString() string

type DeviceGetPropertyData

type DeviceGetPropertyData struct {
	MsgId   string   `json:"msgId"`
	Version string   `json:"version"`
	Time    int64    `json:"time"`
	Data    []string `json:"data"`
}

func (*DeviceGetPropertyData) ToString

func (r *DeviceGetPropertyData) ToString() string

type DeviceGetPropertyResponse

type DeviceGetPropertyResponse struct {
	MsgId string                  `json:"msgId"`
	Data  []EffectivePropertyData `json:"data"`
}

type DeviceImportTemplateRequest

type DeviceImportTemplateRequest struct {
}

type DeviceInfoResponse

type DeviceInfoResponse struct {
	Id                string                 `json:"id"`
	CloudDeviceId     string                 `json:"cloud_device_id"`
	CloudProductId    string                 `json:"cloud_product_id"`
	CloudInstanceId   string                 `json:"cloud_instance_id"`
	Name              string                 `json:"name"`
	Status            constants.DeviceStatus `json:"status"`
	Description       string                 `json:"description"`
	ProductId         string                 `json:"product_id"`
	ProductName       string                 `json:"product_name"`
	Secret            string                 `json:"secret"`
	Platform          constants.IotPlatform  `json:"platform"`
	DeviceServiceName string                 `json:"device_service_name"`
	LastSyncTime      int64                  `json:"last_sync_time"`
	LastOnlineTime    int64                  `json:"last_online_time"`
	Created           int64                  `json:"create_at"`
}

func DeviceInfoResponseFromModel

func DeviceInfoResponseFromModel(p models.Device, deviceServiceName string) DeviceInfoResponse

type DeviceLibrary

type DeviceLibrary struct {
	Id             string
	Name           string // 容器名/软件名
	Alias          string
	Description    string
	Protocol       string
	Version        string
	LibFile        string
	ConfigFile     string
	Config         string
	DockerConfigId string
	DockerRepoName string
	DockerImageId  string
	//SupportVersions []DeviceLibrarySupportVersion
	IsInternal    bool
	OperateStatus string // 下载状态
}

func DeviceLibraryFromModel

func DeviceLibraryFromModel(d models.DeviceLibrary) DeviceLibrary

type DeviceLibraryAddRequest

type DeviceLibraryAddRequest struct {
	Id             string `json:"id,omitempty"`
	Name           string `json:"name" binding:"required"`
	Description    string `json:"description,omitempty"`
	Protocol       string `json:"protocol"`
	Version        string `json:"version" binding:"required"`
	ContainerName  string `json:"container_name" binding:"required"`
	DockerConfigId string `json:"docker_config_id" binding:"required"`
	DockerRepoName string `json:"docker_repo_name" binding:"required"`
	Language       string `json:"language"` //代码语言
	SupportVersion struct {
		IsDefault          bool   `json:"is_default"`
		DockerParamsSwitch bool   `json:"docker_params_switch"`
		DockerParams       string `json:"docker_params"`
		ExpertMode         bool   `json:"expert_mode"`
		ExpertModeContent  string `json:"expert_mode_content"`
		ConfigJson         string `json:"config_json"`
	} `json:"support_version"`
}

type DeviceLibraryResponse

type DeviceLibraryResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//Alias           string                              `json:"alias"`
	Description string `json:"description"`
	//Manufacturer    string                              `json:"manufacturer"`
	Protocol      string `json:"protocol"`
	Version       string `json:"version"`
	ContainerName string `json:"container_name"`
	//ConfigFile      string                              `json:"config_file"`
	DockerConfigId  string                              `json:"docker_config_id"`
	DockerRepoName  string                              `json:"docker_repo_name"`
	OperateStatus   string                              `json:"operate_status"`
	IsInternal      bool                                `json:"is_internal"`
	Manual          string                              `json:"manual"`
	Icon            string                              `json:"icon"`
	ClassifyId      int                                 `json:"classify_id"`
	Created         int64                               `json:"created"`
	Language        string                              `json:"language"`
	SupportVersions []DeviceLibrarySupportVersionSimple `json:"support_versions"` // 用于前端展示可供下载/更新的版本号 key:value == 版本号:配置文件
}

func DeviceLibraryResponseFromModel

func DeviceLibraryResponseFromModel(dl models.DeviceLibrary) DeviceLibraryResponse

type DeviceLibrarySearchQueryRequest

type DeviceLibrarySearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	DockerConfigId           string `form:"docker_config_id" json:"docker_config_id"`
	IsInternal               string `form:"is_internal" json:"is_internal"`
	ClassifyId               int    `form:"classify_id" json:"classify_id"`
	DockerRepoName           string `form:"docker_repo_name" json:"docker_repo_name"`
	NameAliasLike            string `form:"name_alias_like" json:"name_alias_like"`
	DownloadStatus           string `form:"download_status" json:"download_status"`
	DriverType               int    `form:"driver_type" json:"driver_type" binding:"omitempty,oneof=1 2"` // 驱动库类型,1:驱动,2:三方应用
	NoInIds                  string // 约定,没有from的为 内置查询条件
	ImageIds                 string // 内置条件
	NoInImageIds             string // 内置条件
}

type DeviceLibrarySupportVersionSimple

type DeviceLibrarySupportVersionSimple struct {
	Version    string `json:"version"`
	IsDefault  bool   `json:"is_default"`
	ConfigFile string `json:"config_file"`
}

func DeviceLibrarySupportVersionSimpleFromModel

func DeviceLibrarySupportVersionSimpleFromModel(versions models.SupportVersions) []DeviceLibrarySupportVersionSimple

type DeviceLibraryUpgradeRequest

type DeviceLibraryUpgradeRequest struct {
	Id      string `json:"id" binding:"required"`
	Version string `json:"version" binding:"required"`
}

type DeviceLibraryUpgradeResponse

type DeviceLibraryUpgradeResponse struct {
	Id            string `json:"id"`
	Version       string `json:"version"`
	OperateStatus string `json:"operate_status"`
}

type DevicePropertyReport

type DevicePropertyReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	//Time    int64  `json:"time"`
	Sys struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data map[string]ReportData `json:"data"`
}

type DevicePropertySetData

type DevicePropertySetData struct {
	ErrorMessage string `json:"errorMessage"`
	Code         uint32 `json:"code"`
	Success      bool   `json:"success"`
}

type DevicePropertySetResponse

type DevicePropertySetResponse struct {
	MsgId string                `json:"msgId"`
	Data  DevicePropertySetData `json:"data"`
}

type DeviceReportPropertiesValueSearchRequest

type DeviceReportPropertiesValueSearchRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceReportPropertiesValueSearchResponse

type DeviceReportPropertiesValueSearchResponse struct {
	PropertyInfoList []PropertyInfo `json:"property_info_list"`
}

type DeviceSearchQueryRequest

type DeviceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Platform                 string `schema:"platform,omitempty"`
	Name                     string `schema:"name,omitempty"`
	ProductId                string `schema:"product_id,omitempty"`
	CloudProductId           string `schema:"cloud_product_id,omitempty"`
	CloudInstanceId          string `schema:"cloud_instance_id,omitempty"`
	DriveInstanceId          string `schema:"drive_instance_id,omitempty"`
	Status                   string `schema:"status,omitempty"`
}

type DeviceSearchQueryResponse

type DeviceSearchQueryResponse struct {
	Id                string                 `json:"id"`
	Name              string                 `json:"name"`
	ProductId         string                 `json:"product_id"`
	Status            constants.DeviceStatus `json:"status"`
	Platform          constants.IotPlatform  `json:"platform"`
	CloudInstanceId   string                 `json:"cloud_instance_id"`
	CloudProductId    string                 `json:"cloud_product_id"`
	DriverServiceName string                 `json:"driver_service_name"`
	ProductName       string                 `json:"product_name"`
	LastSyncTime      int64                  `json:"last_sync_time"`
	LastOnlineTime    int64                  `json:"last_online_time"`
	DriveInstanceId   string                 `json:"drive_instance_id"`
	Created           int64                  `json:"created"`
	Description       string                 `json:"description"`
}

func DeviceResponseFromModel

func DeviceResponseFromModel(p models.Device, deviceServiceName string) DeviceSearchQueryResponse

type DeviceService

type DeviceService struct {
	Id                 string                 `json:"id,omitempty"`
	Name               string                 `json:"name"`
	Created            int64                  `json:"created,omitempty"`
	Modified           int64                  `json:"modified,omitempty"`
	BaseAddress        string                 `json:"baseAddress"`
	DeviceLibraryId    string                 `json:"deviceLibraryId"`
	Config             map[string]interface{} `json:"config"`
	DockerContainerId  string                 `json:"dockerContainerId"`
	ExpertMode         bool                   `json:"isExpertMode"`
	ExpertModeContent  string                 `json:"expertModeContent"`
	DockerParamsSwitch bool                   `json:"dockerParamsSwitch"`
	DockerParams       string                 `json:"dockerParams"`
	ContainerName      string                 `json:"container_name"`
}

func DeviceServiceFromModel

func DeviceServiceFromModel(ds models.DeviceService) DeviceService

type DeviceServiceAddRequest

type DeviceServiceAddRequest struct {
	Id                 string                 `json:"id,omitempty" binding:"omitempty,t-special-char"`
	Name               string                 `json:"name"`
	DeviceLibraryId    string                 `json:"deviceLibraryId" binding:"required"`
	Config             map[string]interface{} `json:"config" binding:"required"`
	ExpertMode         bool                   `json:"expertMode"`
	ExpertModeContent  string                 `json:"expertModeContent"`
	DockerParamsSwitch bool                   `json:"dockerParamsSwitch"`
	DockerParams       string                 `json:"dockerParams"`
	DriverType         int                    `json:"driverType" binding:"omitempty,oneof=1 2"` //驱动库类型,1:驱动,2:三方应用
}

type DeviceServiceDeleteRequest

type DeviceServiceDeleteRequest struct {
	Id string `json:"id" binding:"required"`
}

type DeviceServiceResponse

type DeviceServiceResponse struct {
	Id            string                `json:"id"`
	Name          string                `json:"name"`
	DeviceLibrary DeviceLibraryResponse `json:"deviceLibrary"`
	//Version       string                `json:"version"`
	RunStatus          int         `json:"runStatus"`
	Config             interface{} `json:"config"`
	ExpertMode         bool        `json:"expertMode"`
	ExpertModeContent  string      `json:"expertModeContent"`
	DockerParamsSwitch bool        `json:"dockerParamsSwitch"`
	DockerParams       string      `json:"dockerParams"`
	CreateAt           int64       `json:"create_at"`
	ImageExist         bool        `json:"imageExist"`
	Platform           string      `json:"platform"`
}

type DeviceServiceRunLogRequest

type DeviceServiceRunLogRequest struct {
	Id      string `json:"id"`
	Operate int    `json:"operate" binding:"required,oneof=1 2"`
}

type DeviceServiceSearchQueryRequest

type DeviceServiceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ProductId                string `form:"productId"`
	CloudProductId           string `form:"cloudProductId"`
	DeviceLibraryId          string `form:"deviceLibraryId"`  // 驱动库ID
	DeviceLibraryIds         string `form:"deviceLibraryIds"` // 驱动库IDs
	Platform                 string `form:"platform"`
	DriverType               int    `form:"driver_type" binding:"omitempty,oneof=1 2"` //驱动库类型,1:驱动,2:三方应用
}

type DeviceServiceUpdateRequest

type DeviceServiceUpdateRequest struct {
	Id                 string                  `json:"id" binding:"required"`
	DeviceLibraryId    *string                 `json:"deviceLibraryId"`
	Name               *string                 `json:"name"`
	Config             *map[string]interface{} `json:"config"`
	ExpertMode         *bool                   `json:"expertMode"`
	ExpertModeContent  *string                 `json:"expertModeContent"`
	DockerParamsSwitch *bool                   `json:"docker_params_switch"`
	DockerParams       *string                 `json:"docker_params"`
	Platform           constants.IotPlatform   `json:"platform"`
}

type DeviceStatusRequest

type DeviceStatusRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceSyncByIdRequest

type DeviceSyncByIdRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceSyncRequest

type DeviceSyncRequest struct {
	CloudInstanceId string `json:"cloud_instance_id"`
	DriveInstanceId string `json:"driver_instance_id"`
}

type DeviceUpdateOrCreateCallBack

type DeviceUpdateOrCreateCallBack struct {
	Id              string                 `json:"id"`
	Name            string                 `json:"name"`
	Description     string                 `json:"description"`
	ProductId       string                 `json:"product_id"`
	Status          constants.DeviceStatus `json:"status"`
	Platform        constants.IotPlatform  `json:"platform"`
	DriveInstanceId string                 `json:"drive_instance_id"`
}

type DeviceUpdateRequest

type DeviceUpdateRequest struct {
	Id              string  `json:"id"`
	Description     *string `json:"description"`
	Name            *string `json:"name"`
	InstallLocation *string `json:"install_location"`
	DriveInstanceId *string `json:"drive_instance_id"`
}

type DevicesBindDriver

type DevicesBindDriver struct {
	DeviceIds        []string `json:"device_ids"`
	DriverInstanceId string   `json:"driver_instance_id,omitempty"`
}

type DevicesBindProductId

type DevicesBindProductId struct {
	ProductId        string `json:"product_id"`
	DriverInstanceId string `json:"driver_instance_id,omitempty"`
}

type DevicesImport

type DevicesImport struct {
	ProductId        string `schema:"product_id,omitempty"`
	DriverInstanceId string `schema:"driver_instance_id,omitempty"`
}

type DevicesUnBindDriver

type DevicesUnBindDriver struct {
	DeviceIds []string `json:"device_ids"`
}

type Doc

type Doc struct {
	Name     string `json:"name"`
	JumpLink string `json:"jumpLink,omitempty"`
}

type DockerConfig

type DockerConfig struct {
	Id       string
	Address  string
	Account  string
	Password string
	SaltKey  string
}

func DockerConfigFromModel

func DockerConfigFromModel(dc models.DockerConfig) DockerConfig

func WincLinkDockerConfig

func WincLinkDockerConfig() DockerConfig

type DockerConfigAddRequest

type DockerConfigAddRequest struct {
	Id       string `json:"id"`
	Address  string `json:"address" binding:"required"` // 仓库地址 true
	Account  string `json:"account,omitempty"`          // 账户
	Password string `json:"password,omitempty"`         // 密码
}

type DockerConfigResponse

type DockerConfigResponse struct {
	Id      string `json:"id"`
	Address string `json:"address"`
	Account string `json:"account"`
}

func DockerConfigResponseFromModel

func DockerConfigResponseFromModel(dc models.DockerConfig) DockerConfigResponse

type DockerConfigSearchQueryRequest

type DockerConfigSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Address                  string `schema:"address"`
	Account                  string `schema:"account"`
}

type DockerConfigUpdateRequest

type DockerConfigUpdateRequest struct {
	Id       string  `json:"id" binding:"required"`
	Address  *string `json:"address"`
	Account  *string `json:"account"`
	Password *string `json:"password"`
}

type DockerManageConfig

type DockerManageConfig struct {
	ContainerConfigPath string // 容器内部驱动运行启动的配置文件路径
	DockerApiVersion    string // docker 版本号
	DockerRunMode       string // 默认运行模式 默认是host
	DockerSelfName      string // edge启动的容器名
	Privileged          bool   // 容器特权
}

type Docs

type Docs struct {
	More string `json:"more"`
	Doc  []Doc  `json:"info"`
}

type DocsSearchQueryRequest

type DocsSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
}

type DriverClassifyQueryRequest

type DriverClassifyQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name"`
}

type DriverClassifyResponse

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

type DriverConfig

type DriverConfig struct {
	Logger      LogConfig
	Clients     map[string]ClientInfo
	Service     ServiceInfo
	CustomParam string
}

type DriverConfigManage

type DriverConfigManage struct {
	HostRootDir string // 宿主主机dir
	NetWorkName string
	DockerManageConfig
}

func (*DriverConfigManage) GetBinPath

func (m *DriverConfigManage) GetBinPath(serverName string) string

func (*DriverConfigManage) GetHostLogFilePath

func (m *DriverConfigManage) GetHostLogFilePath(serviceName string) string

func (*DriverConfigManage) GetHostMntDir

func (m *DriverConfigManage) GetHostMntDir(serviceName string) string

func (*DriverConfigManage) GetHostRunConfigPath

func (m *DriverConfigManage) GetHostRunConfigPath(serviceName string) string

func (*DriverConfigManage) GetLibraryDir

func (m *DriverConfigManage) GetLibraryDir() string

func (*DriverConfigManage) GetLogFilePath

func (m *DriverConfigManage) GetLogFilePath(serviceName string) string

func (*DriverConfigManage) GetMntDir

func (m *DriverConfigManage) GetMntDir(serviceName string) string

func (*DriverConfigManage) GetRunConfigPath

func (m *DriverConfigManage) GetRunConfigPath(serviceName string) string

func (*DriverConfigManage) SetHostRootDir

func (m *DriverConfigManage) SetHostRootDir(dir string)

func (*DriverConfigManage) SetNetworkName

func (m *DriverConfigManage) SetNetworkName(networkName string)

type EdgeXDeviceEventReport

type EdgeXDeviceEventReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	Sys     struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data EventData `json:"data"`
}

type EffectivePropertyData

type EffectivePropertyData struct {
	Code  string      `json:"code"`
	Value interface{} `json:"value"`
	Time  int64       `json:"time"`
}

type EventData

type EventData struct {
	EventCode    string                 `json:"eventCode"`
	EventTime    int64                  `json:"eventTime"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

func (*EventData) Marshal

func (r *EventData) Marshal() ([]byte, error)

type ExportFile

type ExportFile struct {
	Excel    *excelize.File
	FileName string
}

func NewExportFile

func NewExportFile(filename string) (*ExportFile, error)

func (*ExportFile) GetCenterStyle

func (f *ExportFile) GetCenterStyle() int

func (*ExportFile) GetRequiredStyle

func (f *ExportFile) GetRequiredStyle() int

type Filter

type Filter struct {
	MessageSource string `json:"message_source"`
	SelectName    string `json:"select_name"`
	Condition     string `json:"condition"`
	Sql           string `json:"sql"`
}

type GetRuleInfoResponse

type GetRuleInfoResponse struct {
	Triggered bool                     `json:"triggered"`
	Id        string                   `json:"id"`
	Name      string                   `json:"name"`
	Sql       string                   `json:"sql"`
	Actions   []map[string]interface{} `json:"actions"`
	Options   map[string]interface{}   `json:"options"`
}

type GetRuleStatusResponse

type GetRuleStatusResponse struct {
	Status string `json:"status"`
}

type HandleLog

type HandleLog struct {
	Req      interface{} `json:"req"`
	Reply    interface{} `json:"reply"`
	Success  bool        `json:"success"`
	Method   string      `json:"method"`
	Duration string      `json:"duration"`
	Error    string      `json:"error"`
}

func (HandleLog) ToString

func (hl HandleLog) ToString() string

type HomePageRequest

type HomePageRequest struct {
}

type HomePageResponse

type HomePageResponse struct {
	PageInfo struct {
		Product struct {
			Total uint32 `json:"total"`
			Self  uint32 `json:"self"`
			Other uint32 `json:"other"`
		} `json:"product"`
		Device struct {
			Total uint32 `json:"total"`
			Self  uint32 `json:"self"`
			Other uint32 `json:"other"`
		} `json:"device"`
		CloudInstance struct {
			Count     uint32 `json:"count"`
			RunCount  uint32 `json:"run_count"`
			StopCount uint32 `json:"stop_count"`
		} `json:"cloudInstance"`
		Alert struct {
			Total uint32 `json:"total"`
		} `json:"alert"`
	} `json:"pageInfo"`
	QuickNavigation []QuickNavigation         `json:"quickNavigation"`
	Docs            Docs                      `json:"docs"`
	AlertPlate      []AlertPlateQueryResponse `json:"alertPlate"`
	MsgGather       []MsgGather               `json:"msg_gather"`
}

type ImportFile

type ImportFile struct {
	Excel *excelize.File
}

func NewImportFile

func NewImportFile(f io.Reader) (*ImportFile, error)

type InitInfoResponse

type InitInfoResponse struct {
	IsInit bool `json:"isInit"`
}

type InitPasswordRequest

type InitPasswordRequest struct {
	NewPassword string `json:"newPassword" binding:"required"`
}

type InvokeDeviceService

type InvokeDeviceService struct {
	MsgId   string      `json:"msgId"`
	Version string      `json:"version"`
	Time    int64       `json:"time"`
	Data    ServiceData `json:"data"`
}

operationType:SERVICE_EXECUTE data:"topic:\"/sys/hq85KDcqGI6/test_008/thing/service/DeleteAlgorithmModel\" message:\"{\\\"id\\\":\\\"2130175210\\\",\\\"version\\\":\\\"1.0.0\\\",\\\"code\\\":\\\"DeleteAlgorithmModel\\\",\\\"params\\\":{\\\"ForceDelete\\\":3}}\""

func (*InvokeDeviceService) ToString

func (r *InvokeDeviceService) ToString() string

type InvokeDeviceServiceReq

type InvokeDeviceServiceReq struct {
	DeviceId string                 `json:"deviceId"`
	Code     string                 `json:"code"`
	Items    map[string]interface{} `json:"inputParams"`
}

type InvokeLog

type InvokeLog struct {
	Req      interface{} `json:"req"`
	Reply    interface{} `json:"reply"`
	Success  bool        `json:"success"`
	Method   string      `json:"method"`
	Duration string      `json:"duration"`
	Error    string      `json:"error"`
}

func (InvokeLog) ToString

func (il InvokeLog) ToString() string

type JobAction

type JobAction struct {
	ActionType  string      `json:"actionType"`
	ProductId   string      `json:"productId"`
	ProductName string      `json:"product_name"`
	DeviceId    string      `json:"deviceId"`
	DeviceName  string      `json:"deviceName"`
	Code        string      `json:"code"`
	DateType    string      `json:"dateType"`
	Value       interface{} `json:"value"`
}

type LanguageSDK

type LanguageSDK struct {
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Sort        int    `json:"sort"`
	Addr        string `json:"addr"`
	Description string `json:"description"`
}

type LanguageSDKSearchQueryRequest

type LanguageSDKSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
}

type LanguageSDKSearchResponse

type LanguageSDKSearchResponse struct {
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Addr        string `json:"addr"`
	Description string `json:"description"`
}

type LanguageSDKSyncRequest

type LanguageSDKSyncRequest struct {
	VersionName string `json:"version_name"`
}

type LogConfig

type LogConfig struct {
	FileName string
	LogLevel string
}

LogConfig logger common

type LogParam

type LogParam struct {
	Line int `form:"line"`
}

type Logging

type Logging struct {
	Log string `json:"log"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginResponse

type LoginResponse struct {
	User      UserResponse `json:"user"`
	Token     string       `json:"token"`
	ExpiresAt int64        `json:"expiresAt"`
}

type MQTT

type MQTT struct {
	Server             string `json:"server,omitempty"`
	Topic              string `json:"topic,omitempty"`
	ClientId           string `json:"clientId,omitempty"`
	ProtocolVersion    string `json:"protocolVersion,omitempty"`
	Qos                int    `json:"qos,omitempty"`
	Username           string `json:"username,omitempty"`
	Password           string `json:"password,omitempty"`
	CertificationPath  string `json:"certificationPath,omitempty"`
	PrivateKeyPath     string `json:"privateKeyPath,omitempty"`
	RootCaPath         string `json:"rootCaPath,omitempty"`
	InsecureSkipVerify string `json:"insecureSkipVerify,omitempty"`
	Retained           bool   `json:"retained,omitempty"`
}

type MemoryStats

type MemoryStats struct {
	Usage    int64             `json:"usage"`
	Limit    int64             `json:"limit"`
	MaxUsage int64             `json:"max_usage"`
	Stats    MemoryStatsDetail `json:"stats"`
}

type MemoryStatsDetail

type MemoryStatsDetail struct {
	Cache int64 `json:"cache"`
	Rss   int64 `json:"rss"`
}

type MessageBus

type MessageBus struct {
	DeviceId    string      `json:"deviceId"`
	MessageType string      `json:"messageType"`
	Data        interface{} `json:"data"`
}

type Metrics

type Metrics struct {
	Timestamp      int64   `json:"timestamp"`      // 时间戳
	CpuUsedPercent float64 `json:"cpuUsedPercent"` // cpu 使用率百分比
	MemoryUsed     int64   `json:"memoryUsed"`     // 内存使用大小,单位:字节
}

func (Metrics) ToJSON

func (m Metrics) ToJSON() string

type MetricsQuery

type MetricsQuery struct {
	Service     string `form:"service" binding:"required"`                           // 服务ID
	MetricsType string `form:"metrics_type" binding:"oneof=minute hour halfday day"` // 监控类型,范围: minute hour halfday day
	MetricsRangeQuery
}

type MetricsRangeQuery

type MetricsRangeQuery struct {
	Start int64 `form:"start" binding:"gt=0"` // 开始时间戳
	End   int64 `form:"end" binding:"gt=0"`   // 结束时间戳
}

type MetricsResult

type MetricsResult struct {
	Total   int       `json:"total"`
	Metrics []Metrics `json:"metrics"` // 性能点列表
}

swagger:response MetricsResult

type MsgGather

type MsgGather struct {
	Count int    `json:"count"`
	Date  string `json:"date"`
}

type MsgGatherSearchQueryRequest

type MsgGatherSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Date                     []string `schema:"date"`
}

type NetWorkInfo

type NetWorkInfo struct {
	NewWork []NewWork `json:"newWork"`
	Dns     string    `json:"dns"`
}

type NewMQTTClient

type NewMQTTClient struct {
	Broker    string   `json:"broker"`
	ClientId  string   `json:"client_id"`
	Username  string   `json:"username"`
	Password  string   `json:"password"`
	PubTopic  string   `json:"pub_topic"`
	SubTopics []string `json:"sub_topics"`
}

type NewWork

type NewWork struct {
	NcId    string `json:"ncId"`
	LocalIp string `json:"localIp,omitempty"`
	GwIp    string `json:"gwIp,omitempty"`
	SmIp    string `json:"smIp,omitempty"`
	Netlink bool   `json:"netlink"`
}

type Notify

type Notify struct {
	Name            constants.AlertWay `json:"name"` //告警方式
	Option          map[string]string  `json:"option"`
	StartEffectTime string             `json:"start_effect_time"` //生效开始时间
	EndEffectTime   string             `json:"end_effect_time"`   //生效结束时间
}

type OpenApiActions

type OpenApiActions struct {
	Id           string                `json:"id"`
	ProductId    string                `json:"product_id"`
	Name         string                `json:"name"` // 功能名称
	Code         string                `json:"code"` // 标识符
	Required     bool                  `json:"required"`
	CallType     constants.CallType    `json:"call_type"`
	InputParams  []OpenApiInPutParams  `json:"input_params"`  // 输入参数
	OutputParams []OpenApiOutPutParams `json:"output_params"` // 输出参数
	CreatedAt    int64                 `json:"created_at"`
	Description  string                `json:"description"`
}

type OpenApiAddProductRequest

type OpenApiAddProductRequest struct {
	Name        string `json:"name"`        //产品名字
	Protocol    string `json:"protocol"`    //协议
	NodeType    string `json:"node_type"`   //节点类型
	NetType     string `json:"net_type"`    //联网模式
	DataFormat  string `json:"data_format"` //数据类型
	Factory     string `json:"factory"`     //厂家
	Description string `json:"description"` //描述
}

type OpenApiDeviceInfoResponse

type OpenApiDeviceInfoResponse struct {
	Id          string                 `json:"id"`
	Name        string                 `json:"name"`
	Platform    constants.IotPlatform  `json:"platform"`
	Status      constants.DeviceStatus `json:"status"`
	Description string                 `json:"description"`
	ProductId   string                 `json:"product_id"`
	ProductName string                 `json:"product_name"`
	//Secret         string                 `json:"secret"`
	LastOnlineTime int64 `json:"last_online_time"`
	Created        int64 `json:"created_at"`
}

func OpenApiDeviceInfoResponseFromModel

func OpenApiDeviceInfoResponseFromModel(p models.Device) OpenApiDeviceInfoResponse

type OpenApiDeviceStatus

type OpenApiDeviceStatus struct {
	Status constants.DeviceStatus `json:"status"`
}

type OpenApiEvents

type OpenApiEvents struct {
	Id           string                `json:"id"`
	ProductId    string                `json:"product_id"`
	Name         string                `json:"name"` // 功能名称
	Code         string                `json:"code"` // 标识符
	EventType    string                `json:"event_type"`
	Required     bool                  `json:"required"`
	OutputParams []OpenApiOutPutParams `json:"output_params"`
	Description  string                `json:"description"`
	CreatedAt    int64                 `json:"created_at"`
}

type OpenApiInPutParams

type OpenApiInPutParams struct {
	Code     string          `json:"code"`
	Name     string          `json:"name"`
	TypeSpec OpenApiTypeSpec `json:"type_spec"`
}

type OpenApiOutPutParams

type OpenApiOutPutParams struct {
	Code     string          `json:"code"`
	Name     string          `json:"name"`
	TypeSpec OpenApiTypeSpec `json:"type_spec"`
}

type OpenApiProperties

type OpenApiProperties struct {
	Id          string          `json:"id"`
	ProductId   string          `json:"product_id"`  // 产品ID
	Name        string          `json:"name"`        // 属性名称
	Code        string          `json:"code"`        // 标识符
	AccessMode  string          `json:"access_mode"` // 数据传输类型
	Required    bool            `json:"required"`
	TypeSpec    OpenApiTypeSpec `json:"type_spec"` // 数据属性
	Description string          `json:"description"`
	CreatedAt   int64           `json:"created_at"`
}

type OpenApiQueryDevicePropertyData

type OpenApiQueryDevicePropertyData struct {
}

type OpenApiQueryThingModel

type OpenApiQueryThingModel struct {
	Properties []OpenApiThingModelProperties `json:"properties"`
	Events     []OpenApiThingModelEvents     `json:"events"`
	Services   []OpenApiThingModelServices   `json:"services"`
}

type OpenApiQueryThingModelReq

type OpenApiQueryThingModelReq struct {
	ProductId string `schema:"product_id,omitempty"`
}

type OpenApiSetDeviceThingModel

type OpenApiSetDeviceThingModel struct {
	DeviceId string                 `json:"deviceId"`
	Item     map[string]interface{} `json:"item"`
}

type OpenApiThingModelAddOrUpdateReq

type OpenApiThingModelAddOrUpdateReq struct {
	ProductId  string                        `json:"product_id"`
	Properties []OpenApiThingModelProperties `json:"properties"`
	Events     []OpenApiThingModelEvents     `json:"events"`
	Services   []OpenApiThingModelServices   `json:"services"`
}

type OpenApiThingModelDeleteReq

type OpenApiThingModelDeleteReq struct {
	ProductId   string   `json:"product_id"`
	PropertyIds []string `json:"property_ids"`
	EventIds    []string `json:"event_ids"`
	ServiceIds  []string `json:"service_ids"`
}

type OpenApiThingModelEvents

type OpenApiThingModelEvents struct {
	Id           string              `json:"id"`
	EventType    string              `json:"event_type"`
	Name         string              `json:"name"` // 功能名称
	Code         string              `json:"code"` // 标识符
	Description  string              `json:"description"`
	Require      bool                `json:"require"`
	OutputParams models.OutPutParams `json:"output_params"`
}

type OpenApiThingModelProperties

type OpenApiThingModelProperties struct {
	Id          string          `json:"id"`
	Name        string          `json:"name"`        // 属性名称
	Code        string          `json:"code"`        // 标识符
	AccessMode  string          `json:"access_mode"` // 数据传输类型
	Require     bool            `json:"require"`
	TypeSpec    models.TypeSpec `json:"type_spec"` // 数据属性
	Description string          `json:"description"`
}

type OpenApiThingModelServices

type OpenApiThingModelServices struct {
	Id           string              `json:"id"`
	Name         string              `json:"name"` // 功能名称
	Code         string              `json:"code"` // 标识符
	Description  string              `json:"description"`
	Require      bool                `json:"require"`
	CallType     constants.CallType  `json:"call_type"`
	InputParams  models.InPutParams  `json:"input_params"`  // 输入参数
	OutputParams models.OutPutParams `json:"output_params"` // 输出参数
}

type OpenApiTypeSpec

type OpenApiTypeSpec struct {
	Type  constants.SpecsType `json:"type,omitempty"`
	Specs string              `json:"specs,omitempty"`
}

type OpenApiUpdateProductRequest

type OpenApiUpdateProductRequest struct {
	Id          string  `json:"id"`
	Name        *string `json:"name"`        //产品名字
	Protocol    *string `json:"protocol"`    //协议
	NodeType    *string `json:"node_type"`   //节点类型
	NetType     *string `json:"net_type"`    //联网模式
	DataFormat  *string `json:"data_format"` //数据类型
	Factory     *string `json:"factory"`     //厂家
	Description *string `json:"description"` //描述
}

type PageRequest

type PageRequest struct {
	NameLike string `json:"nameLike" form:"nameLike"`
	Page     int    `json:"page" form:"page"`
	PageSize int    `json:"pageSize" form:"pageSize"`
}

type PlatformInfo

type PlatformInfo struct {
	VersionName string `json:"version_name"`
	DbName      string `json:"db_name"`
}

type ProductAddRequest

type ProductAddRequest struct {
	Name string `json:"name"` //产品名字
	//Platform           string `json:"platform"`
	Key                string `json:"key"`
	CategoryTemplateId string `json:"category_template_id"` //如果是自定义 id固定传递"1"
	Protocol           string `json:"protocol"`             //协议
	NodeType           string `json:"node_type"`            //节点类型
	NetType            string `json:"net_type"`             //联网模式
	DataFormat         string `json:"data_format"`          //数据类型
	Factory            string `json:"factory"`              //厂家
	Description        string `json:"description"`          //描述
}

type ProductSearchByIdOpenApiResponse

type ProductSearchByIdOpenApiResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Key         string `json:"key"`
	Platform    string `json:"platform"`
	Protocol    string `json:"protocol"`
	NodeType    string `json:"node_type"`
	NetType     string `json:"net_type"`
	DataFormat  string `json:"data_format"`
	Factory     string `json:"factory"`
	Status      string `json:"status"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
}

type ProductSearchByIdResponse

type ProductSearchByIdResponse struct {
	Id              string      `json:"id"`
	Name            string      `json:"name"`
	Key             string      `json:"key"`
	CloudProductId  string      `json:"cloud_product_id"`
	CloudInstanceId string      `json:"cloud_instance_id"`
	Platform        string      `json:"platform"`
	Protocol        string      `json:"protocol"`
	NodeType        string      `json:"node_type"`
	NetType         string      `json:"net_type"`
	DataFormat      string      `json:"data_format"`
	Factory         string      `json:"factory"`
	Description     string      `json:"description"`
	Status          string      `json:"status"`
	CreatedAt       int64       `json:"created_at"`
	LastSyncTime    int64       `json:"last_sync_time"`
	Properties      interface{} `json:"properties"`
	Events          interface{} `json:"events"`
	Actions         interface{} `json:"actions"`
}

func ProductSearchByIdFromModel

func ProductSearchByIdFromModel(p models.Product) ProductSearchByIdResponse

type ProductSearchOpenApiResponse

type ProductSearchOpenApiResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Key         string `json:"key"`
	Platform    string `json:"platform"`
	Protocol    string `json:"protocol"`
	NodeType    string `json:"node_type"`
	NetType     string `json:"net_type"`
	DataFormat  string `json:"data_format"`
	Factory     string `json:"factory"`
	Status      string `json:"status"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
}

func ProductSearchOpenApiFromModel

func ProductSearchOpenApiFromModel(p models.Product) ProductSearchOpenApiResponse

type ProductSearchQueryRequest

type ProductSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Platform                 string `schema:"platform,omitempty"`
	Name                     string `schema:"name,omitempty"`
	ProductId                string `schema:"product_id,omitempty"`
	CloudInstanceId          string `schema:"cloud_instance_id,omitempty"`
}

type ProductSearchQueryResponse

type ProductSearchQueryResponse struct {
	Id           string `json:"id"`
	ProductId    string `json:"product_id"`
	Name         string `json:"name"`
	Key          string `json:"key"`
	NodeType     string `json:"node_type"`
	Platform     string `json:"platform"`
	Status       string `json:"status"`
	CreatedAt    int64  `json:"created_at"`
	CategoryName string `json:"category_name"`
}

func ProductResponseFromModel

func ProductResponseFromModel(p models.Product) ProductSearchQueryResponse

type ProductSyncByIdRequest

type ProductSyncByIdRequest struct {
	ProductId string `json:"product_id"`
}

type ProductSyncRequest

type ProductSyncRequest struct {
	CloudInstanceId string `json:"cloud_instance_id"`
}

type PropertyInfo

type PropertyInfo struct {
	Code     string `json:"code,omitempty"`
	Value    string `json:"value,omitempty"`
	DataType string `json:"dataType,omitempty"`
	Time     string `json:"time,omitempty"`
	Unit     string `json:"unit,omitempty"`
	Name     string `json:"name,omitempty"`
}

type PropertySet

type PropertySet struct {
	Version string                 `json:"version"`
	MsgId   string                 `json:"msgId"`
	Time    int64                  `json:"time"`
	Params  map[string]interface{} `json:"data"`
}

func (*PropertySet) ToString

func (r *PropertySet) ToString() string

type QuickNavigation

type QuickNavigation struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

type QuickNavigationSearchQueryRequest

type QuickNavigationSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
}

type RPCConfig

type RPCConfig struct {
	Address  string
	UseTLS   bool
	CertFile string
	KeyFile  string
}

RPCConfig internal grpc server common

type ReportData

type ReportData struct {
	Value interface{} `json:"value"`
	Time  int64       `json:"time"`
}

func (*ReportData) Marshal

func (r *ReportData) Marshal() ([]byte, error)

type Rest

type Rest struct {
	Method       string `json:"method,omitempty"`
	Url          string `json:"url,omitempty"`
	BodyType     string `json:"bodyType,omitempty"`
	Timeout      int    `json:"timeout,omitempty"`
	RunAsync     bool   `json:"runAsync,omitempty"`
	OmitIfEmpty  bool   `json:"omitIfEmpty,omitempty"`
	SendSingle   bool   `json:"sendSingle,omitempty"`
	BufferLength int    `json:"bufferLength,omitempty"`
	EnableCache  bool   `json:"enableCache,omitempty"`
	Format       string `json:"format,omitempty"`
}

type RpcData

type RpcData struct {
	Code    WsCode
	ReqId   string
	ErrCode uint32
	Data    interface{}
}

func (*RpcData) String

func (rd *RpcData) String() string

type RuleAddRequest

type RuleAddRequest struct {
	Name        string               `json:"name"`        //名字
	AlertType   constants.AlertType  `json:"alert_type"`  //告警类型
	AlertLevel  constants.AlertLevel `json:"alert_level"` //告警级别
	Description string               `json:"description"` //描述
}

type RuleEngineFieldUpdateRequest

type RuleEngineFieldUpdateRequest struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//AlertLevel  constants.AlertLevel `json:"alert_level"`
	Description string `json:"description"`
}

type RuleEngineRequest

type RuleEngineRequest struct {
	Name           string `json:"name"`        //名字
	Description    string `json:"description"` //描述
	Filter         Filter `json:"filter"`
	DataResourceId string `json:"data_resource_id"`
}

func (RuleEngineRequest) BuildEkuiperSql

func (r RuleEngineRequest) BuildEkuiperSql() string

type RuleEngineResponse

type RuleEngineResponse struct {
	Id             string           `json:"id"`
	Name           string           `json:"name"`
	Description    string           `json:"description"`
	Filter         Filter           `json:"filter"`
	Created        int64            `json:"created"`
	DataResourceId string           `json:"data_resource_id"`
	DataResource   DataResourceInfo `json:"dataResource"`
	Modified       int64            `json:"modified"`
}

type RuleEngineSearchQueryRequest

type RuleEngineSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	Status                   string `schema:"status,omitempty"`
}

type RuleEngineSearchQueryResponse

type RuleEngineSearchQueryResponse struct {
	Id           string           `json:"id"`
	Name         string           `json:"name"`
	Description  string           `json:"description"`
	Created      int64            `json:"created"`
	Status       string           `json:"status"`
	ResourceType string           `json:"resource_type"`
	DataResource DataResourceInfo `json:"dataResource"`
}

func RuleEngineSearchQueryResponseFromModel

func RuleEngineSearchQueryResponseFromModel(p models.RuleEngine) RuleEngineSearchQueryResponse

type RuleEngineUpdateRequest

type RuleEngineUpdateRequest struct {
	Id             string  `json:"id"`
	Name           *string `json:"name"`        //名字
	Description    *string `json:"description"` //描述
	Filter         *Filter `json:"filter"`
	DataResourceId *string `json:"data_resource_id"`
}

func (RuleEngineUpdateRequest) BuildEkuiperSql

func (r RuleEngineUpdateRequest) BuildEkuiperSql() string

type RuleFieldUpdate

type RuleFieldUpdate struct {
	Id          string               `json:"id"`
	Name        string               `json:"name"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	Description string               `json:"description"`
}

type RuleResponse

type RuleResponse struct {
	Id          string                    `json:"id"`
	Name        string                    `json:"name"`
	AlertType   constants.AlertType       `json:"alert_type"`
	AlertLevel  constants.AlertLevel      `json:"alert_level"`
	Status      constants.RuleStatus      `json:"status"`
	Condition   constants.WorkerCondition `json:"condition"`
	SubRule     RuleSubRules              `json:"sub_rule"`
	Notify      models.Notify             `json:"notify"`
	SilenceTime int64                     `json:"silence_time"`
	Description string                    `json:"description"`
	Created     int64                     `json:"created"`
	Modified    int64                     `json:"modified"`
}

type RuleSubRule

type RuleSubRule struct {
	Trigger     constants.Trigger `json:"trigger"` //触发方式
	ProductId   string            `json:"product_id"`
	ProductName string            `json:"product_name"`
	DeviceId    string            `json:"device_id"`
	DeviceName  string            `json:"device_name"`
	Code        string            `json:"code"`
	Condition   string            `json:"condition"`
	Option      map[string]string `json:"option"`
}

type RuleSubRules

type RuleSubRules []RuleSubRule

type RuleUpdateRequest

type RuleUpdateRequest struct {
	Id          string                    `json:"id"`
	Condition   constants.WorkerCondition `json:"condition"` //执行条件
	SubRule     []SubRule                 `json:"sub_rule"`
	Notify      []Notify                  `json:"notify"`
	SilenceTime int64                     `json:"silence_time"` //静默时间
}

func (*RuleUpdateRequest) BuildEkuiperSql

func (b *RuleUpdateRequest) BuildEkuiperSql(deviceId string, specsType constants.SpecsType) string

type RunServiceCfg

type RunServiceCfg struct {
	ImageRepo          string
	RunConfig          string
	DockerMountDevices []string
	DockerParams       string
	DriverName         string // 驱动名
}

启动实例时对应的配置

type SaveServiceIssueData

type SaveServiceIssueData struct {
	MsgId        string                 `json:"msgId"`
	Code         string                 `json:"code"`
	Time         int64                  `json:"time"`
	InputParams  map[string]interface{} `json:"inputParams"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

func (*SaveServiceIssueData) Marshal

func (r *SaveServiceIssueData) Marshal() ([]byte, error)

type SceneAddRequest

type SceneAddRequest struct {
	Name        string `json:"name"`        //名字
	Description string `json:"description"` //描述
}

type SceneLogSearchQueryRequest

type SceneLogSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	StartAt                  int64  `schema:"start_time"`
	EndAt                    int64  `schema:"end_time"`
	SceneId                  string `json:"scene_id"`
}

type SceneSearchQueryRequest

type SceneSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `json:"name"`
	Status                   string `json:"status"`
}

type SceneUpdateRequest

type SceneUpdateRequest struct {
	Id         string      `json:"id"`
	Conditions []Condition `json:"conditions"`
	Actions    []Action    `json:"actions"`
}

type ServiceData

type ServiceData struct {
	Code        string                 `json:"code"`
	InputParams map[string]interface{} `json:"inputParams"`
}

func (*ServiceData) Marshal

func (r *ServiceData) Marshal() ([]byte, error)

type ServiceExecResponse

type ServiceExecResponse struct {
	MsgId        string                 `json:"msgId"`
	Code         string                 `json:"code"`
	Time         int64                  `json:"time"`
	OutputParams map[string]interface{} `json:"data"`
}

func (*ServiceExecResponse) Marshal

func (r *ServiceExecResponse) Marshal() ([]byte, error)

type ServiceInfo

type ServiceInfo struct {
	// ID 驱动实例化后生成的唯一ID,驱动管理服务自动生成。
	// 驱动实例启动后会通过该ID去元数据服务同步设备和更新驱动配置。
	ID     string
	Name   string
	Server RPCConfig
	// ProductList 驱动对应的产品ID列表
	//ProductList []string
	//GwId        string
	//LocalKey    string
	// 跳过激活检查
	Activated bool
}

type ServiceStats

type ServiceStats struct {
	Id          string `json:"id" binding:"required"` //
	Name        string `json:"name" binding:"required"`
	Healthy     bool   `json:"healthy"` // 健康状态
	Created     string `json:"created"`
	LogPath     string `json:"log_path"` // 日志地址, 宿主主机日志路径
	Started     string `json:"started"`  // 服务最近启动时间
	ServiceType string `json:"service_type" binding:"required"`
}

type ServicesStats

type ServicesStats []ServiceStats

swagger:response ServicesStats

func (ServicesStats) Len

func (s ServicesStats) Len() int

func (ServicesStats) Less

func (s ServicesStats) Less(i, j int) bool

func (ServicesStats) Swap

func (s ServicesStats) Swap(i, j int)

type StatsResp

type StatsResp struct {
	MemoryStats MemoryStats `json:"memory_stats"`
	CpuStats    CpuStats    `json:"cpu_stats"`
	PrecpuStats CpuStats    `json:"precpu_stats"`
}

func (StatsResp) CpuDelta

func (s StatsResp) CpuDelta() float64

func (StatsResp) CpuUsage

func (s StatsResp) CpuUsage() float64

CpuUsage %

func (StatsResp) MemoryUsage

func (s StatsResp) MemoryUsage() float64

MemoryUsage %

func (StatsResp) SystemCpuDelta

func (s StatsResp) SystemCpuDelta() float64

func (StatsResp) UsedMemory

func (s StatsResp) UsedMemory() int64

type SubRule

type SubRule struct {
	Trigger   constants.Trigger `json:"trigger"`
	ProductId string            `json:"product_id"`
	DeviceId  string            `json:"device_id"`
	Option    map[string]string `json:"option"`
}

type SystemDisk

type SystemDisk struct {
	Path        string  `json:"path"`         // 获取 / 目录信息
	Total       uint64  `json:"total"`        // 大小  bytes
	Used        uint64  `json:"used"`         // 使用值
	UsedPercent float64 `json:"used_percent"` // 使用百分比
}

type SystemMemory

type SystemMemory struct {
	Total       uint64  `json:"total"`        // 大小
	Used        uint64  `json:"used"`         // 使用大小 bytes
	UsedPercent float64 `json:"used_percent"` // 百分比
}

type SystemMetrics

type SystemMetrics struct {
	Timestamp      int64                    `json:"timestamp"`        // 时间戳
	CpuUsedPercent float64                  `json:"cpu_used_percent"` // cpu 使用率百分比
	CpuAvg         float64                  `json:"cpu_avg"`          // cpu 负载,1分钟
	Memory         SystemMemory             `json:"memory"`           // 内存
	Disk           SystemDisk               `json:"disk"`             // 磁盘使用率
	Network        map[string]SystemNetwork `json:"network"`          // 网卡en/eth的IO
	Openfiles      int                      `json:"openfiles"`        // 文件数,linux 才有
}

func FromModelsSystemMetricsToDTO

func FromModelsSystemMetricsToDTO(m models.SystemMetrics) (SystemMetrics, error)

func (SystemMetrics) String

func (s SystemMetrics) String() string

type SystemMetricsQuery

type SystemMetricsQuery struct {
	Iface       string `form:"iface"`
	MetricsType string `form:"metrics_type" binding:"oneof=hour halfday day"`
}

type SystemMetricsResponse

type SystemMetricsResponse struct {
	Total   int                  `json:"total"`
	Metrics []SystemStatResponse `json:"metrics"`
}

type SystemNetwork

type SystemNetwork struct {
	Name         string `json:"name"`
	BytesSent    uint64 `json:"bytes_sent"`     // 总发送字节
	BytesRecv    uint64 `json:"bytes_recv"`     // 总接收字节
	BytesSentPre uint64 `json:"bytes_sent_pre"` // 单位时间内发送的字节,1分钟
	BytesRecvPre uint64 `json:"bytes_recv_pre"` // 单位时间内接收的字节,1分钟
	Last         int64  `json:"-"`              // 采集时记录,不做输出
}

func (SystemNetwork) String

func (s SystemNetwork) String() string

type SystemStatResponse

type SystemStatResponse struct {
	Timestamp         int64   `json:"timestamp"`           // 时间戳
	CpuUsedPercent    float64 `json:"cpu_used_percent"`    // cpu 使用率百分比
	MemoryTotal       uint64  `json:"memory_total"`        // 内存使用
	MemoryUsed        uint64  `json:"memory_used"`         // 内存使用
	MemoryUsedPercent float64 `json:"memory_used_percent"` // 内存使用率
	DiskTotal         uint64  `json:"disk_total"`
	DiskUsed          uint64  `json:"disk_used"`
	DiskUsedPercent   float64 `json:"disk_used_percent"` // 磁盘使用率
	NetSentBytes      uint64  `json:"net_sent_bytes"`    // 网卡发送字节
	NetRecvBytes      uint64  `json:"net_recv_bytes"`    // 网卡接收字节
	Openfiles         int     `json:"openfiles"`         // 文件句柄数,linux 才有
}

type SystemThingModelSearchReq

type SystemThingModelSearchReq struct {
	ModelName      string `schema:"modelName"`
	ThingModelType string `schema:"thingModelType"`
}

type TerminalParams

type TerminalParams struct {
	Cmd            string   `json:"cmd" binding:"required"`
	Args           []string `json:"args" binding:"required"`
	TimeoutSeconds int      `json:"timeout_seconds" binding:"min=1,max=60"`
}

type ThingModelActions

type ThingModelActions struct {
	CallType    constants.CallType      `json:"call_type"`
	InPutParam  []ThingModelEventAction `json:"input_param"`
	OutPutParam []ThingModelEventAction `json:"output_param"`
}

type ThingModelAddOrUpdateReq

type ThingModelAddOrUpdateReq struct {
	Id             string `json:"id"`
	ProductId      string `json:"product_id"`
	ThingModelType string `json:"thing_model_type"`
	//ModelName      string                `json:"model_name"`
	Name        string                `json:"name"`
	Code        string                `json:"code"`
	Description string                `json:"description"`
	Tag         string                `json:"tag"`
	Property    *ThingModelProperties `json:"property"`
	Event       *ThingModelEvents     `json:"event"`
	Action      *ThingModelActions    `json:"action"`
}

type ThingModelDataBaseRequest

type ThingModelDataBaseRequest struct {
	First bool    `json:"first"`
	Last  bool    `json:"last"`
	Range []int64 `json:"range"`
}

type ThingModelDataResponse

type ThingModelDataResponse struct {
	ReportData
	Code       string `json:"code"`
	DataType   string `json:"data_type"`
	Unit       string `json:"unit"`
	Name       string `json:"name"`
	AccessMode string `json:"access_mode"`
}

type ThingModelDeleteReq

type ThingModelDeleteReq struct {
	ThingModelId   string `json:"thing_model_id"`
	ThingModelType string `json:"thing_model_type"`
}

type ThingModelEventAction

type ThingModelEventAction struct {
	Code     string              `json:"code"`
	Name     string              `json:"name"`
	DataType constants.SpecsType `json:"type"`
	TypeSpec interface{}         `json:"specs"`
}

type ThingModelEventDataRequest

type ThingModelEventDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId  string ` json:"deviceId"`
	EventCode string `json:"eventCode"`
	EventType string `json:"eventType"`
}

type ThingModelEventDataResponse

type ThingModelEventDataResponse struct {
	EventCode  string                 `json:"event_code"`
	EventType  string                 `json:"event_type"`
	OutputData map[string]interface{} `json:"output_data"`
	ReportTime int64                  `json:"report_time"`
	Name       string                 `json:"name"`
}

type ThingModelEventDataResponseArray

type ThingModelEventDataResponseArray []ThingModelEventDataResponse

func (ThingModelEventDataResponseArray) Len

func (ThingModelEventDataResponseArray) Less

func (array ThingModelEventDataResponseArray) Less(i, j int) bool

func (ThingModelEventDataResponseArray) Swap

func (array ThingModelEventDataResponseArray) Swap(i, j int)

type ThingModelEvents

type ThingModelEvents struct {
	EventType   string                  `json:"event_type"`
	OutPutParam []ThingModelEventAction `json:"output_param"`
}

type ThingModelMessage

type ThingModelMessage struct {
	BaseRequest *drivercommon.BaseRequestMessage
	Cid         string `json:"cid"`     // 下发的目标设备id
	OpType      int32  `json:"op_type"` // 消息类型
	Data        string `json:"data"`    // 云端下发消息内容
}

func ThingModelMessageFromThingModelMsg

func ThingModelMessageFromThingModelMsg(msg *thingmodel.ThingModelMsg) ThingModelMessage

func (*ThingModelMessage) GetOpType

func (*ThingModelMessage) IsPersistent

func (m *ThingModelMessage) IsPersistent() bool

func (*ThingModelMessage) String

func (m *ThingModelMessage) String() string

func (*ThingModelMessage) TransformMessageBus

func (m *ThingModelMessage) TransformMessageBus() []byte

func (*ThingModelMessage) TransformMessageDataByBatchReport

func (m *ThingModelMessage) TransformMessageDataByBatchReport() (DeviceBatchReport, error)

func (*ThingModelMessage) TransformMessageDataByEvent

func (m *ThingModelMessage) TransformMessageDataByEvent() (EdgeXDeviceEventReport, error)

func (*ThingModelMessage) TransformMessageDataByGetProperty

func (m *ThingModelMessage) TransformMessageDataByGetProperty() (DeviceGetPropertyResponse, error)

func (*ThingModelMessage) TransformMessageDataByProperty

func (m *ThingModelMessage) TransformMessageDataByProperty() (DevicePropertyReport, error)

func (*ThingModelMessage) TransformMessageDataByService

func (m *ThingModelMessage) TransformMessageDataByService() (SaveServiceIssueData, error)

func (*ThingModelMessage) TransformMessageDataByServiceExec

func (m *ThingModelMessage) TransformMessageDataByServiceExec() (ServiceExecResponse, error)

func (*ThingModelMessage) TransformMessageDataBySetProperty

func (m *ThingModelMessage) TransformMessageDataBySetProperty() (DevicePropertySetResponse, error)

type ThingModelProperties

type ThingModelProperties struct {
	AccessModel string              `json:"access_model"`
	Require     bool                `json:"require"`
	DataType    constants.SpecsType `json:"type"`
	TypeSpec    interface{}         `json:"specs"`
}

type ThingModelPropertyDataRequest

type ThingModelPropertyDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId string ` json:"deviceId"`
	Code     string `json:"code"`
}

type ThingModelPropertyDataResponse

type ThingModelPropertyDataResponse struct {
	ReportData interface{} `json:"report_data"`
	Code       string      `json:"code"`
	DataType   string      `json:"data_type"`
	Unit       string      `json:"unit"`
	Name       string      `json:"name"`
	AccessMode string      `json:"access_mode"`
}

type ThingModelServiceDataRequest

type ThingModelServiceDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId string ` json:"deviceId"`
	Code     string `json:"code"`
}

type ThingModelServiceDataResponse

type ThingModelServiceDataResponse struct {
	ReportTime  int64                  `json:"report_time"`
	Code        string                 `json:"code"`
	ServiceName string                 `json:"service_name"`
	InputData   map[string]interface{} `json:"input_data"`
	OutputData  map[string]interface{} `json:"output_data"`
}

type ThingModelServiceDataResponseArray

type ThingModelServiceDataResponseArray []ThingModelServiceDataResponse

func (ThingModelServiceDataResponseArray) Len

func (ThingModelServiceDataResponseArray) Less

func (array ThingModelServiceDataResponseArray) Less(i, j int) bool

func (ThingModelServiceDataResponseArray) Swap

func (array ThingModelServiceDataResponseArray) Swap(i, j int)

type ThingModelTemplate

type ThingModelTemplate struct {
	Properties []ThingModelTemplateProperties `json:"properties"`
	Events     []ThingModelTemplateEvents     `json:"events"`
	Services   []ThingModelTemplateServices   `json:"services"`
}

type ThingModelTemplateArray

type ThingModelTemplateArray struct {
	ChildDataType string `json:"childDataType"`
	Size          int    `json:"size"`
}

type ThingModelTemplateBool

type ThingModelTemplateBool struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

type ThingModelTemplateDate

type ThingModelTemplateDate struct {
	Length string `json:"length"`
}

type ThingModelTemplateEnum

type ThingModelTemplateEnum struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

type ThingModelTemplateEvents

type ThingModelTemplateEvents struct {
	EventName   string                               `json:"eventName"`
	EventType   string                               `json:"eventType"`
	Identifier  string                               `json:"identifier"`
	Description string                               `json:"description"`
	Required    bool                                 `json:"required"`
	OutputData  []ThingModelTemplateEventsOutputData `json:"outputData"`
}

func (*ThingModelTemplateEvents) TransformModelOutputParams

func (t *ThingModelTemplateEvents) TransformModelOutputParams() (outPutParams models.OutPutParams)

type ThingModelTemplateEventsOutputData

type ThingModelTemplateEventsOutputData struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	Required      bool        `json:"required"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateIntOrFloat

type ThingModelTemplateIntOrFloat struct {
	Max      string `json:"max"`
	Min      string `json:"min"`
	Step     string `json:"step"`
	Unit     string `json:"unit"`
	UnitName string `json:"unitName"`
}

type ThingModelTemplateProperties

type ThingModelTemplateProperties struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	Description   string      `json:"description"`
	Required      bool        `json:"required"`
	RwFlag        string      `json:"rwFlag"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

func (*ThingModelTemplateProperties) TransformModelTypeSpec

func (t *ThingModelTemplateProperties) TransformModelTypeSpec() (typeSpec models.TypeSpec)

type ThingModelTemplateRequest

type ThingModelTemplateRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	CategoryKey              string `schema:"category_key"`
	CategoryName             string `schema:"category_name"`
}

type ThingModelTemplateResponse

type ThingModelTemplateResponse struct {
	Id             string `json:"id"`
	CategoryName   string `json:"category_name"` //品类名称
	CategoryKey    string `json:"category_key"`
	ThingModelJSON string `json:"thing_model_json"`
	//models.Properties
	Properties interface{} `json:"properties"`
	Events     interface{} `json:"events"`
	Actions    interface{} `json:"actions"`
}

type ThingModelTemplateServices

type ThingModelTemplateServices struct {
	ServiceName string                                 `json:"serviceName"`
	Identifier  string                                 `json:"identifier"`
	Description string                                 `json:"description"`
	Required    bool                                   `json:"required"`
	CallType    constants.CallType                     `json:"callType"`
	InputParams []ThingModelTemplateServicesInputParam `json:"inputParams"`
	OutParams   []ThingModelTemplateServicesOutParam   `json:"outParams"`
}

ASYNC SYNC

func (*ThingModelTemplateServices) TransformModelInPutParams

func (t *ThingModelTemplateServices) TransformModelInPutParams() (inPutParams models.InPutParams)

func (*ThingModelTemplateServices) TransformModelOutPutParams

func (t *ThingModelTemplateServices) TransformModelOutPutParams() (outPutParams models.OutPutParams)

type ThingModelTemplateServicesInputParam

type ThingModelTemplateServicesInputParam struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateServicesOutParam

type ThingModelTemplateServicesOutParam struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateStruct

type ThingModelTemplateStruct struct {
	ChildDataType string      `json:"childDataType"`
	ChildName     string      `json:"childName"`
	Identifier    string      `json:"identifier"`
	ChildSpecsDTO interface{} `json:"childSpecsDTO"`
}

type ThingModelTemplateSyncRequest

type ThingModelTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type ThingModelTemplateText

type ThingModelTemplateText struct {
	Length int `json:"length"`
}

type TokenDetail

type TokenDetail struct {
	AccessId     string `json:"access_id"`
	RefreshId    string `json:"refresh_id"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	AtExpires    int64  `json:"at_expires"`
	RtExpires    int64  `json:"rt_expires"`
}

type UnitRequest

type UnitRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	UnitName                 string `schema:"unitName" json:"unitName"`
}

type UnitResponse

type UnitResponse struct {
	Id       string `json:"id"`
	Symbol   string `json:"symbol"`
	UnitName string `json:"unit_name"`
}

func UnitTemplateResponseFromModel

func UnitTemplateResponseFromModel(unitModel models.Unit) UnitResponse

type UnitTemplateSyncRequest

type UnitTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type UpdateDataResource

type UpdateDataResource struct {
	Id     string                  `json:"id"`
	Name   *string                 `json:"name"`
	Type   *string                 `json:"type"`
	Option *map[string]interface{} `json:"option"`
}

type UpdateDeviceLibrary

type UpdateDeviceLibrary struct {
	Id             string  `json:"id" binding:"required"`
	Name           *string `json:"name"`
	Description    *string `json:"description"`
	DockerConfigId *string `json:"docker_config_id"`
	Protocol       *string `json:"protocol"`
	Language       *string `json:"language"`
	Manual         *string `json:"manual"`
	Icon           *string `json:"icon"`
}

type UpdateDeviceServiceRunStatusRequest

type UpdateDeviceServiceRunStatusRequest struct {
	Id        string `json:"id"`
	RunStatus int    `json:"run_status"  binding:"required,oneof=1 2"`
}

type UpdateDeviceServiceRunStatusResponse

type UpdateDeviceServiceRunStatusResponse struct {
	Id        string `json:"id"`
	RunStatus int    `json:"run_status"`
}

type UpdateLangRequest

type UpdateLangRequest struct {
	Lang string `json:"lang" binding:"required"`
}

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	CurrentPassword string `json:"currentPassword" binding:"required"`
	NewPassword     string `json:"newPassword" binding:"required"`
}

type UpdateServiceLogLevelConfigRequest

type UpdateServiceLogLevelConfigRequest struct {
	Id       string `json:"id"` // 驱动或应用ID
	LogLevel int64  `json:"logLevel"`
}

type UserResponse

type UserResponse struct {
	Username string `json:"username"`
	Lang     string `json:"lang"`
}

type WsCode

type WsCode uint32
const (
	WsCodeDeviceLibraryUpgrade   WsCode = 10001 // 驱动下载/升级
	WsCodeDeviceServiceRunStatus WsCode = 10002 // 驱动重启
	WsCodeDeviceLibraryDelete    WsCode = 10003 // 驱动删除
	WsCodeDeviceServiceLog       WsCode = 10004 // 驱动日志

	WsCodeCheckLang WsCode = 30001 // 切换语言

)

Jump to

Keyboard shortcuts

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