leader

package
v0.0.0-...-5241e9a Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElectionConfig

type ElectionConfig struct {
	TTL                               time.Duration
	Name, Namespace, ResourceLockType string
	// contains filtered or unexported fields
}

func NewDefaultElectionConfig

func NewDefaultElectionConfig(namespace, name string, cfg *rest.Config) *ElectionConfig

func NewElectionConfig

func NewElectionConfig(ttl time.Duration, namespace, name, lockType string, cfg *rest.Config) *ElectionConfig

func (*ElectionConfig) Run

func (ec *ElectionConfig) Run(ctx context.Context, id string, onLeader OnLeader, onSwitchLeader OnNewLeader) error

type OnLeader

type OnLeader func(context.Context) error

type OnNewLeader

type OnNewLeader func(string)

Jump to

Keyboard shortcuts

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