Documentation ¶
Overview ¶
Package config 核心配置
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // 设备模型 DeviceModels []DeviceModel `json:"deviceModels" validate:"required"` // 连接配置 Connections map[string]interface{} `json:"connections" validate:"required"` // 协议名称(通过协议名称区分连接模式:客户端、服务端) ProtocolName string `json:"protocolName" validate:"required,oneof=http_server tcp_server modbus mqtt bacnet http_client"` // 配置唯一key,一般对应目录名称 Key string `json:"-" validate:"-"` // 定时任务 Tasks []TimerTask `json:"timerTasks" validate:"-"` }
Config 配置
type Device ¶
type Device struct { DeviceBase // 连接 Key ConnectionKey string `json:"connectionKey" validate:"required"` // 协议参数 Protocol map[string]string `json:"protocol" validate:"-"` }
Device 设备
type DeviceAction ¶
type DeviceAction struct { // 操作名称 Name string `json:"name" validate:"required"` // 读写类型:RW、R、W ReadWrite string `json:"readWrite" validate:"required|oneof=R W RW"` // 资源操作列表 ResourceOperations []ResourceOperation `json:"resourceOperations" validate:""` }
DeviceAction 设备操作
type DeviceBase ¶
type DeviceBase struct { // 设备名称 Name string `json:"name" validate:"required"` // 模型名称 ModelName string `json:"-" validate:"-"` // 设备描述 Description string `json:"description" validate:"required"` }
DeviceBase 设备基础信息
type DeviceModel ¶
type DeviceModel struct { ModelBase // 模型点位列表 DevicePoints []PointMap `json:"devicePoints" validate:"required"` // 模型操作列表 DeviceActions []DeviceAction `json:"deviceActions" validate:""` // 设备列表 Devices []Device `json:"devices" validate:"required"` }
DeviceModel 设备模型
type DriverConfig ¶
type Model ¶
type Model struct { ModelBase Points map[string]PointBase `json:"points"` Devices map[string]DeviceBase `json:"devices"` }
type ModelBase ¶
type ModelBase struct { // 模型名称 Name string `json:"name" validate:"required"` // 云端模型 ID ModelID string `json:"modelId" validate:"required"` // 模型描述 Description string `json:"description" validate:"required"` }
ModelBase 模型基础信息
type PointBase ¶
type PointBase struct { // 点位名称 Name string `json:"name" validate:"required"` // 点位描述 Description string `json:"description" validate:"required"` // 值类型 ValueType string `json:"valueType" validate:"required,oneof=int float string"` // 读写模式 ReadWrite string `json:"readWrite" validate:"required,oneof=int float string"` // 实时上报开关 RealReport bool `json:"realReport" validate:"required,boolean"` // 定时上报 TimerReport string `json:"timerReport" validate:"required"` // 单位 Units string `json:"units" validate:"-"` // 上报模式 ReportMode string `json:"reportMode" validate:"required"` }
PointBase 点位基础信息
type ReadPointsAction ¶
Click to show internal directories.
Click to hide internal directories.