file

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDetector

func NewDetector(pollInterval time.Duration, filename, id string) (*leader.Poller, error)

NewDetector return an implementation of leader detector This implementation checks a file for its content. If the content matches the id of the detector then this instance is the leader.

func NewStore

func NewStore(s string) leader.Store

NewStore returns the store implementation

Types

type Store

type Store string

Store is the location of a file that stores the location of the leader

func (Store) GetLocation

func (s Store) GetLocation() (*url.URL, error)

GetLocation returns the location of the leader

func (Store) UpdateLocation

func (s Store) UpdateLocation(location *url.URL) error

UpdateLocation writes the location to the file.

Jump to

Keyboard shortcuts

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