cluster

package
v0.0.0-...-7cb0e1f Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// change state actions
	START int = iota
	STOP

	// etcd actions
	CREATE int = iota
	UPDATE
	NOOP

	DIRECTOR_KEY = "cluster/director"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Config         *config.Config
	Log            log.FieldLogger
	DirectorState  bool
	DirectorLock   *sync.Mutex
	MemberID       string
	DalClient      dal.IDal // etcd client is/should-be thread safe
	Hostname       string
	StateChan      chan<- bool
	DistributeChan chan<- bool
	OverwatchChan  chan<- *overwatch.Message

	DirectorMonitorLooper   looper.Looper
	DirectorHeartbeatLooper looper.Looper
	MemberHeartbeatLooper   looper.Looper

	base.Component
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config, stateChan, distributeChan chan<- bool, overwatchChan chan<- *overwatch.Message) (*Cluster, error)

func (*Cluster) Start

func (c *Cluster) Start() error

func (*Cluster) Stop

func (c *Cluster) Stop() error

type DirectorJSON

type DirectorJSON struct {
	MemberID   string
	LastUpdate time.Time
}

type ICluster

type ICluster interface {
	Start() error
	// contains filtered or unexported methods
}

type MemberJSON

type MemberJSON struct {
	MemberID      string
	Hostname      string
	ListenAddress string
	LastUpdated   time.Time
	Tags          []string
	Version       string
	SemVer        string
}

Jump to

Keyboard shortcuts

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