nodes

package
v0.0.0-...-35d1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Cluster (-Config) Management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterObserver

type ClusterObserver struct {
	Group string
	Name  string
	Map   *Map
	Del   IDelegate
}

func (*ClusterObserver) Dial

func (c *ClusterObserver) Dial(addr string) (conn io.ReadWriteCloser, err error)

func (*ClusterObserver) Init

func (c *ClusterObserver) Init() *ClusterObserver

func (*ClusterObserver) OnEnter

func (c *ClusterObserver) OnEnter(n *Node)

func (*ClusterObserver) OnLeave

func (c *ClusterObserver) OnLeave(name string)

type IDelegate

type IDelegate interface {
	OnEnter(n string)
	OnLeave(n string)
}

type Map

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

func (*Map) Add

func (m *Map) Add(n *Node)

func (*Map) AllOlderNodes

func (m *Map) AllOlderNodes(self string) []*Node

func (*Map) Get

func (m *Map) Get(name string) (*Node, bool)

func (*Map) GetAny

func (m *Map) GetAny(name string) (*Node, bool)

func (*Map) Init

func (m *Map) Init() *Map

func (*Map) Remove

func (m *Map) Remove(n *Node)

type Metadata

type Metadata struct {
	RpcPort int
	Startup time.Time
	Group   string
}

type Node

type Node struct {
	*Metadata
	Addr net.IP
	Name string
}

func (*Node) Rpc

func (n *Node) Rpc() *NodeRpc

type NodeRpc

type NodeRpc struct {
	Name    string
	Startup time.Time
	Group   string
}

func (*NodeRpc) GetName

func (n *NodeRpc) GetName() (string, bool)

func (*NodeRpc) Match

func (n *NodeRpc) Match(o *NodeRpc) bool

func (*NodeRpc) Metadata

func (n *NodeRpc) Metadata(port int) *Metadata

func (*NodeRpc) ReprName

func (n *NodeRpc) ReprName() string

Jump to

Keyboard shortcuts

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