election

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// Elect selects a new master as uid if there is a no existing master that has
	// been updated within expiration. elected will be true if this uid has been
	// elected as the new master or was already elected.
	Elect(uid string, expiration time.Duration) (elected bool, err error)
}

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

func New

func New(db Database) *Observer

func (*Observer) IsMaster

func (r *Observer) IsMaster() bool

func (*Observer) Run

func (r *Observer) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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