configuration

package
v0.0.0-...-b1a8189 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CONFIG_FILE_PATH = "configuration/config.yaml"

CONFIG_FILE_PATH contains the location of the configuration file

View Source
var CONFIG_MAP_PATH = "/opt/kubeedge/deviceProfile.json"

CONFIG_MAP_PATH contains the location of the configuration file loaded from config map

Functions

This section is empty.

Types

type DeviceInstance

type DeviceInstance struct {
	ID       string `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Protocol string `json:"protocol,omitempty"`
	Model    string `json:"model,omitempty"`
}

DeviceInstance is structure to store device in deviceProfile.json in configmap

type DeviceModel

type DeviceModel struct {
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Properties  []Property `json:"properties,omitempty"`
}

DeviceModel is structure to store deviceModel in deviceProfile.json in configmap

type DeviceProfile

type DeviceProfile struct {
	DeviceInstances []DeviceInstance `json:"deviceInstances,omitempty"`
	DeviceModels    []DeviceModel    `json:"deviceModels,omitempty"`
}

DeviceProfile is structure to store in configMap

func (*DeviceProfile) ReadFromConfigMap

func (deviceProfile *DeviceProfile) ReadFromConfigMap() error

ReadFromConfigMap is used to load the information from the configmaps that are provided from the cloud

type Property

type Property struct {
	Name         string      `json:"name,omitempty"`
	DataType     string      `json:"dataType,omitempty"`
	Description  string      `json:"description,omitempty"`
	AccessMode   string      `json:"accessMode,omitempty"`
	DefaultValue interface{} `json:"defaultValue,omitempty"`
	Minimum      int64       `json:"minimum,omitempty"`
	Maximum      int64       `json:"maximum,omitempty"`
	Unit         string      `json:"unit,omitempty"`
}

Property is structure to store deviceModel property

type ReadConfigFile

type ReadConfigFile struct {
	DeviceName string `yaml:"device-name,omitempty"`
	MQTTURL    string `yaml:"mqtt-url,omitempty"`
}

ReadConfigFile is the structure that is used to read the config file to get configuration information from the user

func (*ReadConfigFile) ReadFromConfigFile

func (readConfigFile *ReadConfigFile) ReadFromConfigFile() error

ReadFromConfigFile is used to load the information from the configuration file

Jump to

Keyboard shortcuts

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