models

package
v0.0.0-...-fc28734 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTemplate

type AccessTemplate struct {
	dm.AccessTemplate `json:",inline"`
	DeviceModel       string `json:"deviceModel,omitempty"`
}

type AllPluginConfigs

type AllPluginConfigs struct {
	DeviceModels   map[string][]dm.DeviceProperty
	AccessTemplate map[string]AccessTemplate
	Devices        map[string]DeviceInfo
}

type DeviceInfo

type DeviceInfo struct {
	dm.DeviceInfo `json:",inline"`
	Driver        string `json:"driver"`
}

type DeviceMetaShadow

type DeviceMetaShadow struct {
	Attributes map[string]interface{} `json:"attrs,omitempty"`
}

type DeviceModelPropertyYaml

type DeviceModelPropertyYaml struct {
	Name           string                   `json:"name,omitempty" yaml:"name,omitempty"`
	Type           string                   `json:"type,omitempty" yaml:"type,omitempty"`
	Mode           string                   `json:"mode,omitempty" yaml:"mode,omitempty"`
	Format         string                   `json:"format,omitempty" yaml:"format,omitempty"`                        // 当 Type 为 date/time 时使用
	EnumType       dm.EnumType              `json:"enumType,omitempty" yaml:"enumType,omitempty" binding:"dive"`     // 当 Type 为 enum 时使用
	ArrayType      dm.ArrayType             `json:"arrayType,omitempty" yaml:"arrayType,omitempty" binding:"dive"`   // 当 Type 为 array 时使用
	ObjectType     map[string]dm.ObjectType `json:"objectType,omitempty" yaml:"objectType,omitempty" binding:"dive"` // 当 Type 为 object 时使用
	ObjectRequired []string                 `json:"objectRequired,omitempty" yaml:"objectRequired,omitempty"`        // 当 Type 为 object 时, 记录必填字段
}

type DriverEngine

type DriverEngine interface {
	Start() error
	Close()
	ProcessPropertyGet(ctx *comctx.Context, msg *v1.Message) error
	ProcessEvent(ctx *comctx.Context, mgx *v1.Message) error
	ProcessDelta(ctx *comctx.Context, mgx *v1.Message) error
	GetAllConfigs(ctx *comctx.Context, drivers []string) *AllPluginConfigs
	GetDevicesStatusByDriver(ctx *comctx.Context, driverName string) map[string]int
	GetDeviceShadow(ctx *comctx.Context, deviceName string) (map[string]dm.ReportProperty, error)
	GetPluginConfigPath(ctx *comctx.Context, driverName string) string
	StartDriver(ctx *comctx.Context, client *plugin.Client, driverName string, path string) error
	UpdateNorthLink(linkConfig *config.UplinkConfig) error
	ContextReload(driverName string, path string) error
}

type FullDriverConfig

type FullDriverConfig struct {
	Devices []DeviceInfo `yaml:"devices" json:"devices"`
	Driver  string       `yaml:"driver" json:"driver"`
}

type MsgChan

type MsgChan struct {
	Msg *v1.Message
	Ctx *comctx.Context
}

type PluginConfig

type PluginConfig struct {
	Models         map[string][]DeviceModelPropertyYaml `json:"models"`
	AccessTemplate map[string]dm.AccessTemplate         `json:"access_template"`
	SubDevices     SubDevices                           `json:"sub_devices"`
}

type SubDevices

type SubDevices struct {
	Devices []dm.DeviceInfo `json:"devices" yaml:"devices"`
	Driver  string          `json:"driver" yaml:"driver"`
}

Jump to

Keyboard shortcuts

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