Documentation ¶
Index ¶
- func NewElection(electionId, id, namespace string, ttl time.Duration, ...) (*leaderelection.LeaderElector, error)
- func NewSimpleElection(electionId, id string, callback func(leader string), c *kubernetes.Clientset) (*leaderelection.LeaderElector, error)
- func RunElection(ctx context.Context, e *leaderelection.LeaderElector)
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.
Click to show internal directories.
Click to hide internal directories.