etcd

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbeddedEtcd

type EmbeddedEtcd struct {
	Port int
	// contains filtered or unexported fields
}

EmbeddedEtcd provides a single node etcd server.

func NewEmbeddedEtcd

func NewEmbeddedEtcd(sa common.ServiceAddress, dataDir string) (*EmbeddedEtcd, error)

func NewEmbeddedEtcdFromConfig

func NewEmbeddedEtcdFromConfig() (*EmbeddedEtcd, error)

func (*EmbeddedEtcd) Stop

func (se *EmbeddedEtcd) Stop() error

type EtcdClient

type EtcdClient struct {
	Client  *etcd.Client
	KeysAPI etcd.KeysAPI
}

func NewEtcdClient

func NewEtcdClient(etcdServers []string, clientTimeout time.Duration) (*EtcdClient, error)

func NewEtcdClientFromConfig

func NewEtcdClientFromConfig() (*EtcdClient, error)

func (*EtcdClient) GetInt64

func (client *EtcdClient) GetInt64(key string) (int64, error)

func (*EtcdClient) SetInt64

func (client *EtcdClient) SetInt64(key string, value int64) error

func (*EtcdClient) Stop

func (client *EtcdClient) Stop()

type EtcdMasterElectionListener added in v0.10.0

type EtcdMasterElectionListener interface {
	OnMaster()
	OnSlave()
}

type EtcdMasterElector added in v0.10.0

type EtcdMasterElector struct {
	sync.RWMutex
	EtcdKeyAPI etcd.KeysAPI
	Host       string
	// contains filtered or unexported fields
}

func NewEtcdMasterElector added in v0.10.0

func NewEtcdMasterElector(host string, serviceType common.ServiceType, key string, etcdClient *EtcdClient) *EtcdMasterElector

func NewEtcdMasterElectorFromConfig added in v0.10.0

func NewEtcdMasterElectorFromConfig(serviceType common.ServiceType, key string, etcdClient *EtcdClient) *EtcdMasterElector

func (*EtcdMasterElector) AddEventListener added in v0.10.0

func (le *EtcdMasterElector) AddEventListener(listener EtcdMasterElectionListener)

func (*EtcdMasterElector) IsMaster added in v0.10.0

func (le *EtcdMasterElector) IsMaster() bool

func (*EtcdMasterElector) Start added in v0.10.0

func (le *EtcdMasterElector) Start()

func (*EtcdMasterElector) StartAndWait added in v0.10.0

func (le *EtcdMasterElector) StartAndWait()

StartAndWait starts the election mechanism and wait for the first election before returning

func (*EtcdMasterElector) Stop added in v0.10.0

func (le *EtcdMasterElector) Stop()

Source Files

  • client.go
  • election.go
  • server.go

Jump to

Keyboard shortcuts

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