leader

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package leader is an election mechanism as explained in https://github.com/kubernetes/client-go/blob/master/examples/leader-election/main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elect

func Elect(config *Config)

Types

type Config

type Config struct {
	LeaseLockName      string
	LeaseLockNamespace string
	LeaseLockId        string
	StopCh             <-chan struct{}
	Ctx                context.Context
	Config             *rest.Config
	Client             *clientset.Clientset
	Namespace          string
	ControllerId       string
	Run                func(
		ctx context.Context,
		stopCh <-chan struct{},
		config *rest.Config,
		client *clientset.Clientset,
		namespace string,
		controllerId string,
	)
	Stop   func(config *rest.Config, client *clientset.Clientset)
	Cancel context.CancelFunc
}

Jump to

Keyboard shortcuts

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