election

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PodIp = "POD_IP"

Variables

This section is empty.

Functions

func GetLeader

func GetLeader() string

func IsMaster

func IsMaster() (bool, string, error)

func Start

func Start(ctx context.Context, cfg *Config, leaderCallback chan struct{})

Types

type Config

type Config struct {
	Id                string
	Kubeconfig        string
	ElectionName      string
	ElectionNamespace string
}

type LeaderData

type LeaderData struct {
	sync.RWMutex
	Name string
	// contains filtered or unexported fields
}

func (*LeaderData) GetLeader

func (l *LeaderData) GetLeader() string

func (*LeaderData) SetLeader

func (l *LeaderData) SetLeader(name string)

Jump to

Keyboard shortcuts

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