plugin

package
v0.0.0-...-e5ebed8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: Apache-2.0, BSD-3-Clause Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultProviderPluginVersion = 1
View Source
const ProviderPluginName = "provider"

Variables

View Source
var Handshake = plugin.HandshakeConfig{

	MagicCookieKey:   "KF_PLUGIN_MAGIC_COOKIE",
	MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2",
}

Handshake is the HandshakeConfig used to configure clients and servers.

VersionedPlugins includes both protocol 5 and 6 because this is the function called in providerFactory (command/meta_providers.go) to set up the initial plugin client config.

Functions

This section is empty.

Types

type GRPCProvider

type GRPCProvider struct {
	// PluginClient provides a reference to the plugin.Client which controls the plugin process.
	// This allows the GRPCProvider a way to shutdown the plugin process.
	PluginClient *plugin.Client
	// contains filtered or unexported fields
}

GRPCProvider handles the client, or core side of the plugin rpc connection. The GRPCProvider methods are mostly a translation layer between the terraform providers types and the grpc proto types, directly converting between the two.

func (*GRPCProvider) Capabilities

func (*GRPCProvider) Close

func (r *GRPCProvider) Close(ctx context.Context)

func (*GRPCProvider) Configure

func (*GRPCProvider) ReadResource

func (*GRPCProvider) StopProvider

type GRPCProviderPlugin

type GRPCProviderPlugin struct {
	plugin.Plugin
	GRPCProvider func() kfplugin1.ProviderServer
}

GRPCProviderPlugin implements plugin.GRPCPlugin for the go-plugin package.

func (*GRPCProviderPlugin) GRPCClient

func (p *GRPCProviderPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*GRPCProviderPlugin) GRPCServer

func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type Provider

type Provider interface {
	Capabilities(ctx context.Context, req *kfplugin1.Capabilities_Request) (*kfplugin1.Capabilities_Response, error)
	Configure(ctx context.Context, req *kfplugin1.Configure_Request) (*kfplugin1.Configure_Response, error)
	StopProvider(ctx context.Context, req *kfplugin1.StopProvider_Request) (*kfplugin1.StopProvider_Response, error)
	ReadDataSource(ctx context.Context, req *kfplugin1.ReadDataSource_Request) (*kfplugin1.ReadDataSource_Response, error)
	ListDataSource(ctx context.Context, req *kfplugin1.ListDataSource_Request) (*kfplugin1.ListDataSource_Response, error)
	//ReadResource(ctx context.Context, req *kfplugin1.ReadResource_Request) (*kfplugin1.ReadResource_Response, error)
	CreateResource(ctx context.Context, req *kfplugin1.CreateResource_Request) (*kfplugin1.CreateResource_Response, error)
	UpdateResource(ctx context.Context, req *kfplugin1.UpdateResource_Request) (*kfplugin1.UpdateResource_Response, error)
	DeleteResource(ctx context.Context, req *kfplugin1.DeleteResource_Request) (*kfplugin1.DeleteResource_Response, error)
	Close(ctx context.Context)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL