Documentation ¶
Index ¶
- type Config
- type FsDevice
- func (d *FsDevice) ConfigSchema() (*hclspec.Spec, error)
- func (d *FsDevice) Fingerprint(ctx context.Context) (<-chan *device.FingerprintResponse, error)
- func (d *FsDevice) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *FsDevice) Reserve(deviceIDs []string) (*device.ContainerReservation, error)
- func (d *FsDevice) SetConfig(c *base.Config) error
- func (d *FsDevice) Stats(ctx context.Context, interval time.Duration) (<-chan *device.StatsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Dir string `codec:"dir"` ListPeriod string `codec:"list_period"` UnhealthyPerm string `codec:"unhealthy_perm"` }
Config contains configuration information for the plugin.
type FsDevice ¶
type FsDevice struct {
// contains filtered or unexported fields
}
FsDevice is an example device plugin. The device plugin exposes files as devices and periodically polls the directory for new files. If a file has a given file permission, it is considered unhealthy. This device plugin is purely for use as an example.
func NewExampleDevice ¶
NewExampleDevice returns a new example device plugin.
func (*FsDevice) ConfigSchema ¶
ConfigSchema returns the plugins configuration schema.
func (*FsDevice) Fingerprint ¶
Fingerprint streams detected devices. If device changes are detected or the devices health changes, messages will be emitted.
func (*FsDevice) PluginInfo ¶
func (d *FsDevice) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo returns information describing the plugin.
func (*FsDevice) Reserve ¶
func (d *FsDevice) Reserve(deviceIDs []string) (*device.ContainerReservation, error)
Reserve returns information on how to mount the given devices.