* Populates ComponentOptions into plugin structs * Maps options for legacy Provider Plugins into PluginOptions * Demos use of PluginOptions in a stub provider * Honors plugin priority and defaultable settings
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
package myplugin
|
|
|
|
import (
|
|
sdk "github.com/hashicorp/vagrant-plugin-sdk"
|
|
"github.com/hashicorp/vagrant-plugin-sdk/component"
|
|
"github.com/hashicorp/vagrant/builtin/myplugin/command"
|
|
"github.com/hashicorp/vagrant/builtin/myplugin/communicator"
|
|
"github.com/hashicorp/vagrant/builtin/myplugin/host"
|
|
"github.com/hashicorp/vagrant/builtin/myplugin/provider"
|
|
"github.com/hashicorp/vagrant/builtin/myplugin/push"
|
|
)
|
|
|
|
//go:generate protoc -I ../../.. --go_opt=plugins=grpc --go_out=../../.. vagrant-ruby/builtin/myplugin/proto/plugin.proto
|
|
|
|
// Locales data bundling
|
|
//go:generate go-bindata -o ./locales/locales.go -pkg locales locales/assets
|
|
|
|
// Options are the SDK options to use for instantiation.
|
|
var CommandOptions = []sdk.Option{
|
|
sdk.WithComponents(
|
|
// &Provider{},
|
|
&command.Command{},
|
|
&host.AlwaysTrueHost{},
|
|
&communicator.DummyCommunicator{},
|
|
&push.Encouragement{},
|
|
),
|
|
sdk.WithComponent(&provider.Happy{}, &component.ProviderOptions{
|
|
Priority: 100,
|
|
}),
|
|
sdk.WithMappers(StructToCommunincatorOptions),
|
|
sdk.WithName("myplugin"),
|
|
}
|