plugins

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 6 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 (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) 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 {
	Init(ctx context.Context, logger hclog.Logger, settings DrainPluginSettings) (DrainPluginInfo, 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
}

type DrainPluginSettings

type DrainPluginSettings struct {
}

type DrainServer

type DrainServer struct {
	Logger hclog.Logger
	Impl   DrainPlugin
}

func (DrainServer) Init

func (s DrainServer) Init(ctx context.Context, request *proto.InitRequest) (*proto.InitResponse, error)

func (DrainServer) IsDrainOk

func (DrainServer) IsHealthy

func (DrainServer) IsSupported

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(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (GRPCDrainPlugin) GRPCServer

func (p GRPCDrainPlugin) GRPCServer(broker *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