election

package
v0.0.2-alpha Latest Latest
Warning

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

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

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the Apache License, Version 2.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeaderElection

type LeaderElection interface {
	// RunOrDie runs the leader election.
	RunOrDie(ctx context.Context, id string) error

	// Leader gets the address of the elected leader.
	Leader() (multiaddr.Multiaddr, error)
}

LeaderElection provides an interface to elect a leader in a kubernetes cluster.

func New

func New(namespace, name, kubeConfigPath string) LeaderElection

New build a new LeaderElection instance in the given namespace, with the given name. The kubeConfigPath is used to create the kubernetes interface. It may be empty if the runtime environment is a pod.

Jump to

Keyboard shortcuts

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