leader

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() (*kubernetes.Clientset, error)

Types

type Candidate

type Candidate interface {
	Start(ctx context.Context) error
	IsLeader() bool
}

func NewAlwaysLeaderCandidate

func NewAlwaysLeaderCandidate() Candidate

func NewKubernetesCandidate

func NewKubernetesCandidate(client kubernetes.Interface, namespace, name, id string, ctrl Controller, logger log.Logger) (Candidate, error)

type Controller

type Controller interface {
	OnNewLeader(self bool, identity string)
	OnStartedLeading(ctx context.Context)
	OnStoppedLeading()
}

type LoggingController

type LoggingController struct {
	log.Logger
}

func (LoggingController) OnNewLeader

func (c LoggingController) OnNewLeader(self bool, identity string)

func (LoggingController) OnStartedLeading

func (c LoggingController) OnStartedLeading(ctx context.Context)

func (LoggingController) OnStoppedLeading

func (c LoggingController) OnStoppedLeading()

Jump to

Keyboard shortcuts

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