vip

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVIPManager

func NewVIPManager(lg *zap.Logger, cfgGetter config.ConfigGetter) (*vipManager, error)

Types

type ConnRejecter added in v1.3.3

type ConnRejecter interface {
	RejectConns() (bool, string)
}

ConnRejecter reports whether the instance is currently rejecting new connections.

type NetworkOperation

type NetworkOperation interface {
	HasIP() (bool, error)
	AddIP(context.Context) error
	DeleteIP(context.Context) error
	SendARP(context.Context) error
	Addr() string
}

NetworkOperation is the interface for adding, deleting, and broadcasting VIP. Extract the operations into an interface to make testing easier.

func NewNetworkOperation

func NewNetworkOperation(addressStr, linkStr string, garpBurstCount int, lg *zap.Logger) (NetworkOperation, error)

type VIPManager

type VIPManager interface {
	Start(context.Context, *clientv3.Client) error
	// SetConnRejecter configures the checker that decides whether the instance is
	// rejecting new connections. When it reports a rejection, the manager resigns
	// the VIP owner so a healthy node takes over, and re-campaigns once it stops
	// rejecting.
	SetConnRejecter(ConnRejecter)
	PreClose()
	Close()
}

Jump to

Keyboard shortcuts

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