global

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBaseClient

type DataBaseClient interface {
	InitDbClient() error
	CloseSession()

	AddData(data *common.DataModel)

	GetDataByDeviceID(deviceID string) ([]*common.DataModel, error)
	GetPropertyDataByDeviceID(deviceID string, propertyData string) ([]*common.DataModel, error)
	GetDataByTimeRange(start int64, end int64) ([]*common.DataModel, error)

	DeleteDataByTimeRange(start int64, end int64) ([]*common.DataModel, error)
}

DataBaseClient defined database interface, save data and provide data to REST API

type DataPanel

type DataPanel interface {

	// InitPushMethod initialization operation before push
	InitPushMethod() error
	// Push implement push operation
	Push(data *common.DataModel)
}

DataPanel defined push method, parse the push operation in CRD and execute it

type DevPanel

type DevPanel interface {
	// DevStart start device to collect/push/save data to edgecore/app/database
	DevStart()
	// DevInit get device info by dmi interface
	DevInit(deviceList []*dmiapi.Device, deviceModelList []*dmiapi.DeviceModel) error
	// UpdateDev update device's config and restart the device
	UpdateDev(model *common.DeviceModel, device *common.DeviceInstance)
	// UpdateDevTwins update device twin's config and restart the device
	UpdateDevTwins(deviceID string, twins []common.Twin) error
	// DealDeviceTwinGet get device's twin data
	DealDeviceTwinGet(deviceID string, twinName string) (interface{}, error)
	// GetDevice get device's instance info
	GetDevice(deviceID string) (interface{}, error)
	// RemoveDevice stop device and remove device
	RemoveDevice(deviceID string) error
	// WriteDevice write value to the device
	WriteDevice(deviceMethodName, deviceID, propertyName, data string) error
	// GetModel get model's info
	GetModel(modelID string) (common.DeviceModel, error)
	// UpdateModel update model in map only
	UpdateModel(model *common.DeviceModel)
	// RemoveModel remove model in map only
	RemoveModel(modelID string)
	// GetTwinResult get device's property value and datatype
	GetTwinResult(deviceID string, twinName string) (string, string, error)
	// GetDeviceMethod get device's instance info
	GetDeviceMethod(deviceID string) (map[string][]string, map[string]string, error)
}

DevPanel defined operations on devices, manage the lifecycle of devices

Jump to

Keyboard shortcuts

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