Documentation ¶
Index ¶
- type Option
- func CaptureConfigureError(errp *error) Option
- func CaptureLoadError(errp *error) Option
- func Configure(plainConfig string) Option
- func ConfigureJSON(jsonConfig interface{}) Option
- func Configuref(format string, args ...interface{}) Option
- func CoreConfig(coreConfig catalog.CoreConfig) Option
- func HostServices(hostServices ...pluginsdk.ServiceServer) Option
- func Log(log logrus.FieldLogger) Option
- func Services(serviceFacades ...catalog.Facade) Option
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is plugin test option
func CaptureConfigureError ¶
CaptureLoadError captures the error encountered during configuration. If configuration fails, and this option is not provided, the test will fail.
func CaptureLoadError ¶
CaptureLoadError captures the error encountered during loading. If loading fails, and this option is not provided, the test will fail.
func ConfigureJSON ¶
func ConfigureJSON(jsonConfig interface{}) Option
ConfigureJSON marshals the given object and passes the resulting JSON to the plugin for configuration.
func Configuref ¶
Configuref provides a formatted string to the plugin for configuration.
func CoreConfig ¶
func CoreConfig(coreConfig catalog.CoreConfig) Option
CoreConfig provides the core configuration passed to the plugin when configured.
func HostServices ¶
func HostServices(hostServices ...pluginsdk.ServiceServer) Option
HostServices sets the host services the host will offer to the plugin.
type Plugin ¶
type Plugin interface { catalog.Configurer io.Closer }
func Load ¶
func Load(t *testing.T, builtIn catalog.BuiltIn, pluginFacade catalog.Facade, options ...Option) Plugin
Load loads a built-in plugin for testing with the given options. The plugin facade can be nil. If one of the Configure* options is given, the plugin will also be configured. The plugin will unload when the test is over. The function returns a plugin interface that can be closed to unload the built-in before the test is finished or used to reconfigure the plugin, but can otherwise be ignored.