backend

package
v0.0.0-...-09ac470 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// TryBecomeMaster tries to create a value in ETCD under the master key.
	// On success, we're the master, otherwise we're the slave.
	TryBecomeMaster(ourRedisUrl string) (bool, string, error)

	// UpdateMaster tries to update the master key
	UpdateMaster(ourRedisUrl string) error

	// RemoveMaster tries to remove the master key so another instance can become master
	RemoveMaster(ourRedisUrl string) error

	// WatchForMasterChanges watched ETCD for changes in the master key.
	// It will return as soon as a master change was detected.
	WatchForMasterChanges(masterURL string) error
}

func NewEtcdBackend

func NewEtcdBackend(log *logging.Logger, endpoints []string, etcdPath string, masterTTL time.Duration) (Backend, error)

NewEtcdBackend creates a new Backend that uses ETCD.

func NewKubernetesBackend

func NewKubernetesBackend(log *logging.Logger, namespace, replicaSetName, annotationKey, ourMasterURL string, masterTTL time.Duration) (Backend, error)

NewKubernetesBackend creates a new Backend that uses Kubernetes API.

Jump to

Keyboard shortcuts

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