manager

package
v0.0.0-...-8171c4f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceManager

type DeviceManager interface {
	GetDevice(string) *sdk.Device
	NewDevice(*config.DeviceProto, *config.DeviceInstance) (*sdk.Device, error)
	RegisterDevice(*sdk.Device) error
	GenerateDeviceID(*sdk.Device) string
}

DeviceManager provides an interface for managing SDK devices for the plugin.

This interface is used as a sort of side-step around the fact that the SDK has a tightly controlled API and doesn't provide direct access to the internal device manager.

func NewPluginDeviceManager

func NewPluginDeviceManager(plugin *sdk.Plugin) DeviceManager

NewPluginDeviceManager creates a new DeviceManager for SDK Plugin instances.

func NewStubDeviceManager

func NewStubDeviceManager(withError bool) DeviceManager

NewStubDeviceManager creates a new DeviceManager for testing.

type StubDeviceManager

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

StubDeviceManager implements the DeviceManager interface. It provides a stub device manager useful for testing.

func (*StubDeviceManager) GenerateDeviceID

func (dm *StubDeviceManager) GenerateDeviceID(device *sdk.Device) string

GenerateDeviceID generates a fake device ID for the given device.

func (*StubDeviceManager) GetDevice

func (dm *StubDeviceManager) GetDevice(id string) *sdk.Device

GetDevice gets an SDK Device.

func (*StubDeviceManager) NewDevice

func (dm *StubDeviceManager) NewDevice(proto *config.DeviceProto, inst *config.DeviceInstance) (*sdk.Device, error)

NewDevice creates a new SDK Device.

func (*StubDeviceManager) RegisterDevice

func (dm *StubDeviceManager) RegisterDevice(device *sdk.Device) error

RegisterDevice registers an SDK Device.

Jump to

Keyboard shortcuts

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