device

package
v0.0.0-...-80ece84 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FingerprintPeriod string `codec:"fingerprint_period"`
}

Config contains configuration information for the plugin.

type GenicamDevicePlugin

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

GenicamDevicePlugin contains a skeleton for most of the implementation of a device plugin.

func NewPlugin

func NewPlugin(log log.Logger) *GenicamDevicePlugin

NewPlugin returns a device plugin, used primarily by the main wrapper

Plugin configuration isn't available yet, so there will typically be a limit to the initialization that can be performed at this point.

func (*GenicamDevicePlugin) ConfigSchema

func (d *GenicamDevicePlugin) ConfigSchema() (*hclspec.Spec, error)

ConfigSchema returns the configuration schema for the plugin.

This is called during Nomad client startup, immediately before parsing plugin config and calling SetConfig

func (*GenicamDevicePlugin) Fingerprint

func (d *GenicamDevicePlugin) Fingerprint(ctx context.Context) (<-chan *device.FingerprintResponse, error)

Fingerprint streams detected devices. Messages should be emitted to the returned channel when there are changes to the devices or their health.

func (*GenicamDevicePlugin) PluginInfo

func (d *GenicamDevicePlugin) PluginInfo() (*base.PluginInfoResponse, error)

PluginInfo returns information describing the plugin.

This is called during Nomad client startup, while discovering and loading plugins.

func (*GenicamDevicePlugin) Reserve

func (d *GenicamDevicePlugin) Reserve(deviceIDs []string) (*device.ContainerReservation, error)

Reserve returns information to the task driver on on how to mount the given devices. It may also perform any device-specific orchestration necessary to prepare the device for use. This is called in a pre-start hook on the client, before starting the workload.

func (*GenicamDevicePlugin) SetConfig

func (d *GenicamDevicePlugin) SetConfig(c *base.Config) error

SetConfig is called by the client to pass the configuration for the plugin.

func (*GenicamDevicePlugin) Stats

func (d *GenicamDevicePlugin) Stats(ctx context.Context, interval time.Duration) (<-chan *device.StatsResponse, error)

Stats streams statistics for the detected devices. Messages should be emitted to the returned channel on the specified interval.

Jump to

Keyboard shortcuts

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