elector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger logr.Logger

	// leaseLockName is the lease lock resource name
	LeaseLockName string `json:"leaseLockName,omitempty"`

	// leaseLockNamespace is the lease lock resource namespace
	LeaseLockNamespace string `json:"leaseLockNamespace,omitempty"`

	// kubeconfig path to kubeconfig file
	KubeConfig string `json:"kubeconfig,omitempty"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Elector

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

func NewElector

func NewElector(cfg *Config) *Elector

func (*Elector) GetLeader

func (e *Elector) GetLeader() bool

func (*Elector) Run

func (e *Elector) Run(stopCh <-chan struct{})

func (*Elector) SetLeader

func (e *Elector) SetLeader(leader bool)

Jump to

Keyboard shortcuts

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