detect

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Masters

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

Masters detects changes of leader and/or master elections and sends these changes to a channel.

func NewMasters

func NewMasters(masters []string, changed chan<- []string) *Masters

NewMasters returns a new Masters detector with the given initial masters and the given changed channel to which master changes will be sent to. Initially the leader is unknown which is represented by setting the first item of the sent masters slice to be empty.

func (*Masters) OnMasterChanged

func (ms *Masters) OnMasterChanged(leader *mesos.MasterInfo)

OnMasterChanged sets the given MasterInfo as the current leader leaving the remaining masters unchanged and emits the current masters state. It implements the detector.MasterChanged interface.

func (*Masters) UpdatedMasters

func (ms *Masters) UpdatedMasters(infos []*mesos.MasterInfo)

UpdatedMasters sets the given slice of MasterInfo as the current remaining masters leaving the current leader unchanged and emits the current masters state. It implements the detector.AllMasters interface.

Jump to

Keyboard shortcuts

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