Documentation ¶
Index ¶
- func GetMetadataServerIP(ConfigPath string) (string, int, error)
- func GetServerIP(ConfigPath string) (string, int, error)
- func SetClients(host string, protocol string, timeout int)
- func SetDevice(dataTransform bool, initCmd string, initCmdArgs string, maxCmdOps int, ...)
- func SetDeviceList(name string, profile string, description string, label []string)
- func SetRegistry(host string, port int)
- func SetService(host string, port int, label []string)
- func SetWritable(level string)
- func SetYaml(name, manufac, model, desc string, labels []string, resources []DeviceResource)
- func TomlMarshal() (b []byte, err error)
- func YamlMarshal() (b []byte, err error)
- type Client
- type Clients
- type Device
- type DeviceList
- type DeviceProperties
- type DeviceResource
- type Property
- type PropertyDetail
- type ProtocolProperties
- type Registry
- type Service
- type Toml
- type Writable
- type Yaml
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMetadataServerIP ¶
GetMetadataServerIP is used to obtain the IP and port number of Metadata
func GetServerIP ¶
GetServerIP is used to obtain server IP from the configuration.toml file
func SetClients ¶
SetClients configures the service information in terms of Data and Metadata.
func SetDevice ¶
func SetDevice(dataTransform bool, initCmd string, initCmdArgs string, maxCmdOps int, maxCmdValueLen int, removeCmd string, removeCmdArgs string, profilesDir string)
SetDevice configures the Device's common information.
func SetDeviceList ¶
SetDeviceList configures the specific Device information
func SetRegistry ¶
SetRegistry configures the Registry information.
func SetService ¶
SetService configures the Service information.
func SetYaml ¶
func SetYaml(name, manufac, model, desc string, labels []string, resources []DeviceResource)
SetYaml configures the device resource information.
func TomlMarshal ¶
TomlMarshal returns bytes for DataStorage configuration.
func YamlMarshal ¶
YamlMarshal returns bytes for DataStorage device resource configuration.
Types ¶
type Client ¶
type Client struct { Host string `toml:"Host"` Port int `toml:"Port"` Protocol string `toml:"Protocol"` Timeout int `toml:"Timeout,omitempty"` }
Client contains other service information for DataStroage.
type Device ¶
type Device struct { DataTransform bool `toml:"DataTransform,omitempty"` InitCmd string `toml:"InitCmd"` InitCmdArgs string `toml:"InitCmdArgs"` MaxCmdOps int `toml:"MaxCmdOps,omitempty"` MaxCmdValueLen int `toml:"MaxCmdValueLen,omitempty"` RemoveCmd string `toml:"RemoveCmd"` RemoveCmdArgs string `toml:"RemoveCmdArgs"` ProfilesDir string `toml:"ProfilesDir,omitempty"` }
Device contains the configuration for the DataStorage device.
type DeviceList ¶
type DeviceList []DeviceProperties
DeviceList is a list of the DevicesPropertieses.
type DeviceProperties ¶
type DeviceProperties struct { Name string `toml:"Name"` Profile string `toml:"Profile"` Description string `toml:"Description,omitempty"` Labels []string `toml:"Labels,omitempty"` Protocols map[string]ProtocolProperties `toml:"Protocols,omitempty"` }
DeviceProperties contains the configuration for a specific device.
type DeviceResource ¶
type DeviceResource struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` Properties Property `yaml:"properties"` }
DeviceResource contains the resource information.
type Property ¶
type Property struct { Value PropertyDetail `yaml:"value,flow"` Units PropertyDetail `yaml:"units,flow"` }
Property has the value and units properties.
type PropertyDetail ¶
type PropertyDetail struct { Type string `yaml:"type"` ReadWrite string `yaml:"readWrite"` MediaType string `yaml:"mediaType,omitempty"` }
PropertyDetail contains the specific property(Value and Units) information. Type : bool, int8 - int64, uint8 - uint64, float32, float64, string, binary types are supported. ReadWrite : R, RW, or W
type ProtocolProperties ¶
ProtocolProperties is a map of device protocols.
type Registry ¶
type Registry struct { Host string `toml:"Host"` Port int `toml:"Port"` Type string `toml:"Type"` CheckInterval string `toml:"CheckInterval,omitempty"` FailLimit int `toml:"FailLimit,omitempty"` FailWaitTime int `toml:"FailWaitTime,omitempty"` }
Registry contains the configuration for the DataStorage in terms of the Registry server.
type Service ¶
type Service struct { Host string `toml:"Host"` Port int `toml:"Port"` ConnectionRetries int `toml:"ConnectionRetries,omitempty"` Labels []string `toml:"Labels"` OpenMsg string `toml:"OpenMsg,omitempty"` Timeout int `toml:"Timeout,omitempty"` EnableAsyncReadings bool `toml:"EnableAsyncReadings,omitempty"` AsyncBufferSize int `toml:"AsyncBufferSize,omitempty"` }
Service contains the configuration for the DataStorage service.
type Toml ¶
type Toml struct { Writable Writable Service Service Registry Registry Device Device DeviceList DeviceList Clients Clients }
Toml contains the struct for building the DataStorage configuration file.
type Writable ¶
type Writable struct {
LogLevel string `toml:"LogLevel,omitempty"`
}
Writable contains the configuration for the DataStorage log.
type Yaml ¶
type Yaml struct { Name string `yaml:"name"` Manufacturer string `yaml:"manufacturer"` Model string `yaml:"model"` Labels []string `yaml:"labels,omitempty"` Description string `yaml:"description,omitempty"` DeviceResources []DeviceResource `yaml:"deviceResources,omitempty"` }
Yaml contains the struct for building the DataStorage Device Resources configuration.