mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 00:45:43 +03:00
This PR introduces: * An example device plugin that exposes files as devices for testing. * Helpers for serving a device plugin * A launcher binary that allows interacting with a device plugin without needing a Nomad client.
19 lines
367 B
Go
19 lines
367 B
Go
package main
|
|
|
|
import (
|
|
log "github.com/hashicorp/go-hclog"
|
|
|
|
"github.com/hashicorp/nomad/plugins"
|
|
"github.com/hashicorp/nomad/plugins/device/cmd/example"
|
|
)
|
|
|
|
func main() {
|
|
// Serve the plugin
|
|
plugins.Serve(factory)
|
|
}
|
|
|
|
// factory returns a new instance of our example device plugin
|
|
func factory(log log.Logger) interface{} {
|
|
return example.NewExampleDevice(log)
|
|
}
|