plugins

package
v0.0.0-...-21becc5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "KUBESWITCH_PLUGIN",
	MagicCookieValue: "kubeswitch",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	"store": &StorePlugin{},
}

PluginMap is the map of plugins we can dispense.

Functions

This section is empty.

Types

type GRPCClient

type GRPCClient struct {
	Store
	// contains filtered or unexported fields
}

func (*GRPCClient) GetContextPrefix

func (m *GRPCClient) GetContextPrefix(ctx context.Context, path string) (string, error)

func (*GRPCClient) GetID

func (m *GRPCClient) GetID(ctx context.Context) (string, error)

func (*GRPCClient) GetKubeconfigForPath

func (m *GRPCClient) GetKubeconfigForPath(ctx context.Context, path string, tags map[string]string) ([]byte, error)

func (*GRPCClient) StartSearch

func (m *GRPCClient) StartSearch(ctx context.Context, channel chan storetypes.SearchResult)

func (*GRPCClient) VerifyKubeconfigPaths

func (m *GRPCClient) VerifyKubeconfigPaths(ctx context.Context) error

type GRPCServer

type GRPCServer struct {
	// This is the real implementation
	Impl Store
}

func (*GRPCServer) GetID

type Store

type Store interface {
	GetID(ctx context.Context) (string, error)
	GetContextPrefix(ctx context.Context, path string) (string, error)
	VerifyKubeconfigPaths(ctx context.Context) error
	StartSearch(ctx context.Context, channel chan storetypes.SearchResult)
	GetKubeconfigForPath(ctx context.Context, path string, tags map[string]string) ([]byte, error)
}

type StorePlugin

type StorePlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl Store
}

StorePlugin is the implementation of plugin.Plugin so we can serve/consume this.

func (*StorePlugin) GRPCClient

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

func (*StorePlugin) GRPCServer

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

Directories

Path Synopsis
kubeconfigstore
v1

Jump to

Keyboard shortcuts

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