Documentation
¶
Index ¶
- func AddDevice(device models.Device) (string, error)
- func AddDeviceProfile(profile models.DeviceProfile) (string, error)
- func AddRoute(route string, handler func(http.ResponseWriter, *http.Request), ...) error
- func DeviceCommand(deviceName string, commandName string) (models.DeviceCommand, bool)
- func DeviceProfiles() []models.DeviceProfile
- func DeviceResource(deviceName string, deviceResource string) (models.DeviceResource, bool)
- func Devices() []models.Device
- func DriverConfigs() map[string]string
- func GetDeviceByName(name string) (models.Device, error)
- func GetLoggingClient() logger.LoggingClient
- func GetProfileByName(name string) (models.DeviceProfile, error)
- func LoadCustomConfig(customConfig service.UpdatableConfig, sectionName string) error
- func RemoveDeviceByName(name string) error
- func RemoveDeviceProfileByName(name string) error
- func ReportEvent(event *contracts.AsyncValues) error
- func SetDeviceOffline(deviceName string, reason string)
- func SetDeviceOnline(deviceName string)
- func UpdateDevice(device models.Device) error
- func UpdateDeviceProfile(profile models.DeviceProfile) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDevice ¶
AddDevice adds a new Device to the Device Service and Core Metadata. Returns new Device id or non-nil error.
func AddDeviceProfile ¶
func AddDeviceProfile(profile models.DeviceProfile) (string, error)
AddDeviceProfile adds a new DeviceProfile to the Device Service and Core Metadata. Returns new DeviceProfile id or non-nil error.
func AddRoute ¶
func AddRoute(route string, handler func(http.ResponseWriter, *http.Request), methods ...string) error
AddRoute allows leveraging the existing internal web server to add routes specific to Device Service.
func DeviceCommand ¶
func DeviceCommand(deviceName string, commandName string) (models.DeviceCommand, bool)
DeviceCommand retrieves the specific DeviceCommand instance from cache according to the Device name and Command name
func DeviceProfiles ¶
func DeviceProfiles() []models.DeviceProfile
DeviceProfiles return all managed DeviceProfiles from cache
func DeviceResource ¶
func DeviceResource(deviceName string, deviceResource string) (models.DeviceResource, bool)
DeviceResource retrieves the specific DeviceResource instance from cache according to the Device name and Device Resource name
func DriverConfigs ¶
DriverConfigs retrieves the driver specific configuration
func GetDeviceByName ¶
GetDeviceByName returns the Device by its name if it exists in the cache, or returns an error.
func GetLoggingClient ¶
func GetLoggingClient() logger.LoggingClient
GetLoggingClient returns the logger.LoggingClient. The name was chosen to avoid conflicts with service.DeviceService.LoggingClient struct field.
func GetProfileByName ¶
func GetProfileByName(name string) (models.DeviceProfile, error)
GetProfileByName returns the Profile by its name if it exists in the cache, or returns an error.
func LoadCustomConfig ¶
func LoadCustomConfig(customConfig service.UpdatableConfig, sectionName string) error
LoadCustomConfig uses the Config Processor from go-mod-bootstrap to attempt to load service's custom configuration. It uses the same command line flags to process the custom config in the same manner as the standard configuration.
func RemoveDeviceByName ¶
RemoveDeviceByName removes the specified Device by name from the cache and ensures that the instance in Core Metadata is also removed.
func RemoveDeviceProfileByName ¶
RemoveDeviceProfileByName removes the specified DeviceProfile by name from the cache and ensures that the instance in Core Metadata is also removed.
func ReportEvent ¶ added in v1.1.0
func ReportEvent(event *contracts.AsyncValues) error
func SetDeviceOffline ¶
SetDeviceOffline will call the SetDeviceOffline interface impl by the status manager
func SetDeviceOnline ¶
func SetDeviceOnline(deviceName string)
SetDeviceOnline will call the SetDeviceOnline interface impl by the status manager
func UpdateDevice ¶
UpdateDevice updates the Device in the cache and ensures that the copy in Core Metadata is also updated.
func UpdateDeviceProfile ¶
func UpdateDeviceProfile(profile models.DeviceProfile) error
UpdateDeviceProfile updates the DeviceProfile in the cache and ensures that the copy in Core Metadata is also updated.
Types ¶
This section is empty.