Documentation ¶
Index ¶
- Constants
- type Config
- type Plugin
- func (d *Plugin) ConfigSchema() (*hclspec.Spec, error)
- func (d *Plugin) Fingerprint(ctx context.Context) (<-chan *device.FingerprintResponse, error)
- func (d *Plugin) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *Plugin) Reserve(deviceIDs []string) (*device.ContainerReservation, error)
- func (d *Plugin) SetConfig(c *base.Config) error
- func (d *Plugin) Stats(ctx context.Context, interval time.Duration) (<-chan *device.StatsResponse, error)
Constants ¶
const ( DefaultTimeout = time.Second * 10 DefaultInterval = time.Second * 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
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 (*Plugin) ConfigSchema ¶
ConfigSchema returns the configuration schema for the plugin.
This is called during Nomad client startup, immediately before parsing plugin config and calling SetConfig
func (*Plugin) Fingerprint ¶
Fingerprint streams detected devices. Messages should be emitted to the returned channel when there are changes to the devices or their health.
func (*Plugin) PluginInfo ¶
func (d *Plugin) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo returns information describing the plugin.
This is called during Nomad client startup, while discovering and loading plugins.
func (*Plugin) Reserve ¶
func (d *Plugin) Reserve(deviceIDs []string) (*device.ContainerReservation, error)