election

package
v0.0.0-...-1cdbe87 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewElection

func NewElection(electionId, id, namespace string, ttl time.Duration, callback func(leader string), c *kubernetes.Clientset) (*leaderelection.LeaderElector, error)

NewElection creates an election. 'namespace'/'election' should be an existing Kubernetes Service 'id' is the id if this leader, should be unique.

func NewSimpleElection

func NewSimpleElection(electionId, id string, callback func(leader string), c *kubernetes.Clientset) (*leaderelection.LeaderElector, error)

NewSimpleElection creates an election, it defaults namespace to 'default' and ttl to 10s

func RunElection

func RunElection(ctx context.Context, e *leaderelection.LeaderElector)

RunElection runs an election given an leader elector. Doesn't return.

Types

This section is empty.

Jump to

Keyboard shortcuts

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