Documentation
¶
Overview ¶
This package provides a basic EdgeX Foundry device service implementation meant to be embedded in an command, similar in approach to the builtin net/http package.
Index ¶
- func DriverConfigs() map[string]interface{}
- func Main(serviceName string, serviceVersion string, proto interface{}, ...)
- type Bootstrap
- type DeviceService
- func (s *DeviceService) AddDeviceAutoEvent(deviceName string, event models.AutoEvent) error
- func (s *DeviceService) AddRoute(route string, handler func(http.ResponseWriter, *http.Request), ...) error
- func (s *DeviceService) AsyncReadings() bool
- func (s *DeviceService) DeviceDiscovery() bool
- func (s *DeviceService) Initialize(serviceName, serviceVersion string, proto interface{})
- func (s *DeviceService) Name() string
- func (s *DeviceService) RemoveDeviceAutoEvent(deviceName string, event models.AutoEvent) error
- func (s *DeviceService) Stop(force bool)
- func (s *DeviceService) UpdateFromContainer(r *mux.Router, dic *di.Container)
- func (s *DeviceService) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DriverConfigs ¶
func DriverConfigs() map[string]interface{}
DriverConfigs retrieves the driver specific configuration
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// contains filtered or unexported fields
}
Bootstrap contains references to dependencies required by the BootstrapHandler.
func NewBootstrap ¶
NewBootstrap is a factory method that returns an initialized Bootstrap receiver struct.
type DeviceService ¶
type DeviceService struct { ServiceName string LoggingClient logger.LoggingClient // contains filtered or unexported fields }
func RunningService ¶
func RunningService() *DeviceService
func (*DeviceService) AddDeviceAutoEvent ¶
func (s *DeviceService) AddDeviceAutoEvent(deviceName string, event models.AutoEvent) error
AddDeviceAutoEvent adds a new AutoEvent to the Device with given name
func (*DeviceService) AddRoute ¶
func (s *DeviceService) 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 (*DeviceService) AsyncReadings ¶
func (s *DeviceService) AsyncReadings() bool
AsyncReadings returns a bool value to indicate whether the asynchronous reading is enabled.
func (*DeviceService) DeviceDiscovery ¶
func (s *DeviceService) DeviceDiscovery() bool
func (*DeviceService) Initialize ¶
func (s *DeviceService) Initialize(serviceName, serviceVersion string, proto interface{})
func (*DeviceService) Name ¶
func (s *DeviceService) Name() string
Name returns the name of this Device Service
func (*DeviceService) RemoveDeviceAutoEvent ¶
func (s *DeviceService) RemoveDeviceAutoEvent(deviceName string, event models.AutoEvent) error
RemoveDeviceAutoEvent removes an AutoEvent from the Device with given name
func (*DeviceService) UpdateFromContainer ¶
func (s *DeviceService) UpdateFromContainer(r *mux.Router, dic *di.Container)
func (*DeviceService) Version ¶
func (s *DeviceService) Version() string
Version returns the version number of this Device Service