plugin
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
const (// The constants below are the names of the plugins that can be dispensed// from the plugin server.//// Deprecated: This is no longer used, but left for backwards compatibility// since it is exported. It will be removed in the next major version.ProviderPluginName = "provider")
Variables¶
var Handshake =plugin.HandshakeConfig{MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE",MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2",}Handshake is the HandshakeConfig used to configure clients and servers.
Deprecated: This is no longer used, but left for backwards compatibilitysince it is exported. It will be removed in the next major version.
Functions¶
funcDebugdeprecated
Debug starts a debug server and controls its lifecycle, printing theinformation needed for Terraform to connect to the provider to stdout.os.Interrupt will be captured and used to stop the server.
Deprecated: Use the Serve function with the ServeOpts Debug field instead.
Types¶
typeGRPCProviderFunc¶
type GRPCProviderFunc func()tfprotov5.ProviderServer
typeGRPCProviderV6Func¶added inv2.7.0
type GRPCProviderV6Func func()tfprotov6.ProviderServer
typeProviderFunc¶
typeReattachConfig¶
type ReattachConfig struct {ProtocolstringProtocolVersionintPidintTestboolAddrReattachConfigAddr}ReattachConfig holds the information Terraform needs to be able to attachitself to a provider process, so it can drive the process.
funcDebugServe¶
func DebugServe(ctxcontext.Context, opts *ServeOpts) (ReattachConfig, <-chan struct{},error)
DebugServe starts a plugin server in debug mode; this should only be usedwhen the provider will manage its own lifecycle. It is not recommended fornormal usage; Serve is the correct function for that.
typeReattachConfigAddr¶
ReattachConfigAddr is a JSON-encoding friendly version of net.Addr.
typeServeOpts¶
type ServeOpts struct {ProviderFuncProviderFunc// Wrapped versions of the above plugins will automatically shimmed and// added to the GRPC functions when possible.GRPCProviderFuncGRPCProviderFuncGRPCProviderV6FuncGRPCProviderV6Func// Logger is the logger that go-plugin will use.Loggerhclog.Logger// Debug starts a debug server and controls its lifecycle, printing the// information needed for Terraform to connect to the provider to stdout.// os.Interrupt will be captured and used to stop the server.//// Ensure the ProviderAddr field is correctly set when this is enabled,// otherwise the TF_REATTACH_PROVIDERS environment variable will not// correctly point Terraform to the running provider binary.//// This option cannot be combined with TestConfig.Debugbool// TestConfig should only be set when the provider is being tested; it// will opt out of go-plugin's lifecycle management and other features,// and will use the supplied configuration options to control the// plugin's lifecycle and communicate connection information. See the// go-plugin GoDoc for more information.//// This option cannot be combined with Debug.TestConfig *plugin.ServeTestConfig// Set NoLogOutputOverride to not override the log output with an hclog// adapter. This should only be used when running the plugin in// acceptance tests.NoLogOutputOverridebool// UseTFLogSink is the testing.T for a test function that will turn on// the terraform-plugin-log logging sink.UseTFLogSinktesting.T// ProviderAddr is the address of the provider under test or debugging,// such as registry.terraform.io/hashicorp/random. This value is used in// the TF_REATTACH_PROVIDERS environment variable during debugging so// Terraform can correctly match the provider address in the Terraform// configuration to the running provider binary.ProviderAddrstring}ServeOpts are the configurations to serve a plugin.