gossip

package
v0.0.0-...-62b3d66 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebug

func SetDebug(w io.Writer)

Types

type Config

type Config struct {
	Addr string

	InitialPeers []string

	GossipConfig *memberlist.Config

	Logger *jolt.Logger
}

type Gossip

type Gossip struct {
	*memberlist.Memberlist
	// contains filtered or unexported fields
}

TODO: gossip should be the top level membership with myriad.Cluster?

func NewGossip

func NewGossip(c *memberlist.Config) (*Gossip, error)

func (*Gossip) Events

func (g *Gossip) Events() <-chan memberlist.NodeEvent

func (*Gossip) Join

func (g *Gossip) Join(existing []string) (int, error)

func (*Gossip) Members

func (g *Gossip) Members() []*Member

func (*Gossip) SetLocalNode

func (g *Gossip) SetLocalNode(m *Member) error

type GossipLayer

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

func NewGossipLayer

func NewGossipLayer(addr string) (*GossipLayer, error)

func (*GossipLayer) DialTimeout

func (l *GossipLayer) DialTimeout(addr string, timeout time.Duration) (net.Conn, error)

func (*GossipLayer) FinalAdvertiseAddr

func (l *GossipLayer) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error)

func (*GossipLayer) Handoff

func (l *GossipLayer) Handoff(c net.Conn) error

func (*GossipLayer) PacketCh

func (l *GossipLayer) PacketCh() <-chan *memberlist.Packet

func (*GossipLayer) Shutdown

func (l *GossipLayer) Shutdown() error

func (*GossipLayer) StreamCh

func (l *GossipLayer) StreamCh() <-chan net.Conn

func (*GossipLayer) Type

func (l *GossipLayer) Type() rpc.RPCType

func (*GossipLayer) WriteTo

func (l *GossipLayer) WriteTo(b []byte, addr string) (time.Time, error)

type Member

type Member struct {
	ID   string `json:"id"`
	Host string `json:"host"`
	Port int    `json:"port"`
}

func (*Member) Address

func (m *Member) Address() string

func (*Member) Name

func (m *Member) Name() string

func (*Member) String

func (m *Member) String() string

type NodeMeta

type NodeMeta struct {
	LocalNode *Member `json:"localnode"`
}

Jump to

Keyboard shortcuts

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