Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client describes a ETCD configuration client
func NewClient ¶
func NewClient(service common.Service, etcdServers []string, clientTimeout time.Duration) (*Client, error)
NewClient creates a new ETCD client connection to ETCD servers
func (*Client) NewElection ¶
func (client *Client) NewElection(name string) common.MasterElection
NewElection creates a new ETCD master elector
type EmbeddedEtcd ¶
type EmbeddedEtcd struct { Port int // contains filtered or unexported fields }
EmbeddedEtcd provides a single node etcd server.
type MasterElector ¶
type MasterElector struct { common.RWMutex EtcdKeyAPI etcd.KeysAPI Host string // contains filtered or unexported fields }
MasterElector describes an ETCD master elector
func NewMasterElector ¶
func NewMasterElector(etcdClient *Client, key string) *MasterElector
NewMasterElector creates a new ETCD master elector
func (*MasterElector) AddEventListener ¶
func (le *MasterElector) AddEventListener(listener common.MasterElectionListener)
AddEventListener registers a new listener
func (*MasterElector) IsMaster ¶
func (le *MasterElector) IsMaster() bool
IsMaster returns true if the current instance is master
func (*MasterElector) StartAndWait ¶
func (le *MasterElector) StartAndWait()
StartAndWait starts the election mechanism and wait for the first election before returning
Click to show internal directories.
Click to hide internal directories.