plugins

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	MagicCookieKey:   "NODEDRAIN_PLUGIN",
	MagicCookieValue: "4ae46e30-c5de-4ab9-a2c5-4618fdcab7ae",
}

Functions

func Serve

func Serve(impl DrainPlugin)

Types

type DrainClient

type DrainClient struct {
	// contains filtered or unexported fields
}

func (DrainClient) Init

func (c DrainClient) Init(ctx context.Context, _ hclog.Logger, settings DrainPluginSettings) error

func (DrainClient) IsDrainOk

func (c DrainClient) IsDrainOk(ctx context.Context, nodeName string) (bool, error)

func (DrainClient) IsHealthy

func (c DrainClient) IsHealthy(ctx context.Context) (bool, error)

func (DrainClient) IsSupported

func (c DrainClient) IsSupported(ctx context.Context) (bool, error)

func (DrainClient) PluginInfo added in v0.0.3

func (c DrainClient) PluginInfo(ctx context.Context) (DrainPluginInfo, error)

func (DrainClient) PostDrain

func (c DrainClient) PostDrain(ctx context.Context, nodeName string) error

func (DrainClient) PreDrain

func (c DrainClient) PreDrain(ctx context.Context, nodeName string) error

type DrainPlugin

type DrainPlugin interface {
	PluginInfo(ctx context.Context) (DrainPluginInfo, error)
	Init(ctx context.Context, logger hclog.Logger, settings DrainPluginSettings) error
	IsSupported(ctx context.Context) (bool, error)
	IsHealthy(ctx context.Context) (bool, error)
	IsDrainOk(ctx context.Context, nodeName string) (bool, error)
	PreDrain(ctx context.Context, nodeName string) error
	PostDrain(ctx context.Context, nodeName string) error
}

type DrainPluginInfo

type DrainPluginInfo struct {
	ID           string
	ConfigFormat pluginv1.ConfigFormat
}

type DrainPluginSettings

type DrainPluginSettings struct {
	Config []byte
}

type DrainServer

type DrainServer struct {
	Logger hclog.Logger
	Impl   DrainPlugin
}

func (DrainServer) Init

func (DrainServer) IsDrainOk

func (DrainServer) IsHealthy

func (DrainServer) IsSupported

func (DrainServer) PluginInfo added in v0.0.3

func (DrainServer) PostDrain

func (DrainServer) PreDrain

type GRPCDrainPlugin

type GRPCDrainPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Logger hclog.Logger
	Impl   DrainPlugin
}

func (GRPCDrainPlugin) GRPCClient

func (p GRPCDrainPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (GRPCDrainPlugin) GRPCServer

func (p GRPCDrainPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error

Directories

Path Synopsis
proto
v1

Jump to

Keyboard shortcuts

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