Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Handshake = plugin.HandshakeConfig{
MagicCookieKey: "CQ_PLUGIN_COOKIE",
MagicCookieValue: "6753812e-79c2-4af5-ad01-e6083c374e1f",
}
Functions ¶
func Debug ¶
Debug starts a debug server and controls its lifecycle, printing the information needed for CloudQuery to connect to the provider via stdout. os.Interrupt will be captured and used to stop the server.
func ParseReattachProviders ¶
parse information on reattaching to unmanaged providers out of a JSON-encoded environment variable.
Types ¶
type Options ¶
type Options struct { // Required: Name of provider Name string // Required: Provider is the actual provider that will be served. Provider cqproto.CQProviderServer // Optional: Logger is the logger that go-plugin will use. Logger hclog.Logger // Optional: Set NoLogOutputOverride to not override the log output with an hclog // adapter. This should only be used when running the plugin in // acceptance tests. NoLogOutputOverride bool // 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. TestConfig *plugin.ServeTestConfig }
type ReattachConfig ¶
type ReattachConfig struct { Protocol string Pid int Test bool Addr ReattachConfigAddr }
ReattachConfig holds the information needed to be able to attach itself to a provider process, so it can drive the process.
func DebugServe ¶
func DebugServe(ctx context.Context, opts *Options) (ReattachConfig, <-chan struct{}, error)
DebugServe starts a plugin server in debug mode; this should only be used when the provider will manage its own lifecycle. It is not recommended for normal usage; Serve is the correct function for that.
type ReattachConfigAddr ¶
ReattachConfigAddr is a JSON-encoding friendly version of net.Addr.