election

package
v0.0.0-...-e20f597 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package election provides interfaces used for master election.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterElector

type MasterElector interface {
	// RequestMaster makes the caller represented by 'id' enter into a master election for the
	// distributed lock defined by 'path'
	// The returned watch.Interface provides a stream of Master objects which
	// contain the current master.
	// Calling Stop on the returned interface relinquishes ownership (if currently possesed)
	// and removes the caller from the election
	Elect(path, id string) watch.Interface
}

MasterElector is an interface for services that can elect masters. Important Note: MasterElectors are not inter-operable, all participants in the election need to be

using the same underlying implementation of this interface for correct behavior.

func NewEtcdMasterElector

func NewEtcdMasterElector(h tools.EtcdGetSet) MasterElector

NewEtcdMasterElector returns an implementation of election.MasterElector backed by etcd

Jump to

Keyboard shortcuts

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