elector

package
v0.0.0-...-43b7830 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeaderCallbacks

type LeaderCallbacks struct {
	// OnStartedLeading is called when a LeaderElector client starts leading
	OnStartedLeading func(shardId int)
	// OnStoppedLeading is called when a LeaderElector client stops leading
	OnStoppedLeading func(shardId int)
}

type LeaderElector

type LeaderElector interface {
	Run(ctx context.Context)
	IsLeader(shardId int) bool
	GetLeaders() map[int]proxyv1alpha1.EndpointInfo
	SetCallbacks(LeaderCallbacks)
}

func NewLeaderElector

func NewLeaderElector(config componentbaseconfig.LeaderElectionConfiguration, client clientset.Interface, identity string, ShardingCount int) (LeaderElector, error)

Jump to

Keyboard shortcuts

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