api

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDevice

func AddDevice(device models.Device) (string, error)

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 Devices

func Devices() []models.Device

Devices return all managed Devices from cache.

func DriverConfigs

func DriverConfigs() map[string]string

DriverConfigs retrieves the driver specific configuration

func GetDeviceByName

func GetDeviceByName(name string) (models.Device, error)

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

func RemoveDeviceByName(name string) error

RemoveDeviceByName removes the specified Device by name from the cache and ensures that the instance in Core Metadata is also removed.

func RemoveDeviceProfileByName

func RemoveDeviceProfileByName(name string) error

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

func SetDeviceOffline(deviceName string, reason string)

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

func UpdateDevice(device models.Device) error

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.

Jump to

Keyboard shortcuts

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