{"modulePath":"github.com/anth0d/nomad","version":"v0.0.0-20221214183521-ae3a0a2cad06","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package example\n\n## Types\n\n```go\ntype Config struct {\n\tDir           string `codec:\"dir\"`\n\tListPeriod    string `codec:\"list_period\"`\n\tUnhealthyPerm string `codec:\"unhealthy_perm\"`\n}\n```\nConfig contains configuration information for the plugin.\n\n```go\ntype FsDevice struct {\n\t// contains filtered or unexported fields\n}\n```\nFsDevice 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.\n\n```go\nfunc NewExampleDevice(log log.Logger) *FsDevice\n```\nNewExampleDevice returns a new example device plugin.\n\n```go\nfunc (d *FsDevice) ConfigSchema() (*hclspec.Spec, error)\n```\nConfigSchema returns the plugins configuration schema.\n\n```go\nfunc (d *FsDevice) Fingerprint(ctx context.Context) (\u003c-chan *device.FingerprintResponse, error)\n```\nFingerprint streams detected devices. If device changes are detected or the devices health changes, messages will be emitted.\n\n```go\nfunc (d *FsDevice) PluginInfo() (*base.PluginInfoResponse, error)\n```\nPluginInfo returns information describing the plugin.\n\n```go\nfunc (d *FsDevice) Reserve(deviceIDs []string) (*device.ContainerReservation, error)\n```\nReserve returns information on how to mount the given devices.\n\n```go\nfunc (d *FsDevice) SetConfig(c *base.Config) error\n```\nSetConfig is used to set the configuration of the plugin.\n\n```go\nfunc (d *FsDevice) Stats(ctx context.Context, interval time.Duration) (\u003c-chan *device.StatsResponse, error)\n```\nStats streams statistics for the detected devices.\n\n","path":"github.com/anth0d/nomad/plugins/device/cmd/example","name":"example","synopsis":"","isRedistributable":true}
