Files
nomad/plugins/device/cmd/example/cmd/main.go
Alex Dadgar a0b01d16c6 Example device plugin and helpers
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.
2018-08-28 13:59:57 -07:00

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)
}