service

package
v0.0.0-...-2dca463 Latest Latest
Warning

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

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

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DriverConfigs

func DriverConfigs() map[string]interface{}

DriverConfigs retrieves the driver specific configuration

func Main

func Main(serviceName string, serviceVersion string, proto interface{}, ctx context.Context, cancel context.CancelFunc, router *mux.Router)

Types

type Bootstrap

type Bootstrap struct {
	// contains filtered or unexported fields
}

Bootstrap contains references to dependencies required by the BootstrapHandler.

func NewBootstrap

func NewBootstrap(router *mux.Router) *Bootstrap

NewBootstrap is a factory method that returns an initialized Bootstrap receiver struct.

func (*Bootstrap) BootstrapHandler

func (b *Bootstrap) BootstrapHandler(ctx context.Context, wg *sync.WaitGroup, startupTimer startup.Timer, dic *di.Container) (success bool)

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) Stop

func (s *DeviceService) Stop(force bool)

Stop shuts down the Service

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

Jump to

Keyboard shortcuts

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