Versions in this module Expand all Collapse all v0 v0.1.0 Apr 13, 2017 Changes in this version + const MetaMaxSize + const ProtocolVersion2Compatible + const ProtocolVersionMax + const ProtocolVersionMin + func LogAddress(addr net.Addr) string + func LogConn(conn net.Conn) string + func ValidateKey(key []byte) error + type AliveDelegate interface + NotifyAlive func(peer *Node) error + type Broadcast interface + Finished func() + Invalidates func(b Broadcast) bool + Message func() []byte + type ChannelEventDelegate struct + Ch chan<- NodeEvent + func (c *ChannelEventDelegate) NotifyJoin(n *Node) + func (c *ChannelEventDelegate) NotifyLeave(n *Node) + func (c *ChannelEventDelegate) NotifyUpdate(n *Node) + type Config struct + AdvertiseAddr string + AdvertisePort int + Alive AliveDelegate + AwarenessMaxMultiplier int + BindAddr string + BindPort int + Conflict ConflictDelegate + DNSConfigPath string + Delegate Delegate + DelegateProtocolMax uint8 + DelegateProtocolMin uint8 + DelegateProtocolVersion uint8 + DisableTcpPings bool + EnableCompression bool + Events EventDelegate + GossipInterval time.Duration + GossipNodes int + GossipToTheDeadTime time.Duration + HandoffQueueDepth int + IndirectChecks int + Keyring *Keyring + LogOutput io.Writer + Logger *log.Logger + Merge MergeDelegate + Name string + Ping PingDelegate + ProbeInterval time.Duration + ProbeTimeout time.Duration + ProtocolVersion uint8 + PushPullInterval time.Duration + RetransmitMult int + SecretKey []byte + SuspicionMaxTimeoutMult int + SuspicionMult int + TCPTimeout time.Duration + Transport Transport + UDPBufferSize int + func DefaultLANConfig() *Config + func DefaultLocalConfig() *Config + func DefaultWANConfig() *Config + func (c *Config) EncryptionEnabled() bool + type ConflictDelegate interface + NotifyConflict func(existing, other *Node) + type Delegate interface + GetBroadcasts func(overhead, limit int) [][]byte + LocalState func(join bool) []byte + MergeRemoteState func(buf []byte, join bool) + NodeMeta func(limit int) []byte + NotifyMsg func([]byte) + type EventDelegate interface + NotifyJoin func(*Node) + NotifyLeave func(*Node) + NotifyUpdate func(*Node) + type Keyring struct + func NewKeyring(keys [][]byte, primaryKey []byte) (*Keyring, error) + func (k *Keyring) AddKey(key []byte) error + func (k *Keyring) GetKeys() [][]byte + func (k *Keyring) GetPrimaryKey() (key []byte) + func (k *Keyring) RemoveKey(key []byte) error + func (k *Keyring) UseKey(key []byte) error + type Memberlist struct + func Create(conf *Config) (*Memberlist, error) + func (m *Memberlist) GetHealthScore() int + func (m *Memberlist) Join(existing []string) (int, error) + func (m *Memberlist) Leave(timeout time.Duration) error + func (m *Memberlist) LocalNode() *Node + func (m *Memberlist) Members() []*Node + func (m *Memberlist) NumMembers() (alive int) + func (m *Memberlist) Ping(node string, addr net.Addr) (time.Duration, error) + func (m *Memberlist) ProtocolVersion() uint8 + func (m *Memberlist) SendBestEffort(to *Node, msg []byte) error + func (m *Memberlist) SendReliable(to *Node, msg []byte) error + func (m *Memberlist) SendTo(to net.Addr, msg []byte) error + func (m *Memberlist) SendToTCP(to *Node, msg []byte) error + func (m *Memberlist) SendToUDP(to *Node, msg []byte) error + func (m *Memberlist) Shutdown() error + func (m *Memberlist) UpdateNode(timeout time.Duration) error + type MergeDelegate interface + NotifyMerge func(peers []*Node) error + type MockAddress struct + func (a *MockAddress) Network() string + func (a *MockAddress) String() string + type MockNetwork struct + func (n *MockNetwork) NewTransport() *MockTransport + type MockTransport struct + func (t *MockTransport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error) + func (t *MockTransport) FinalAdvertiseAddr(string, int) (net.IP, int, error) + func (t *MockTransport) PacketCh() <-chan *Packet + func (t *MockTransport) Shutdown() error + func (t *MockTransport) StreamCh() <-chan net.Conn + func (t *MockTransport) WriteTo(b []byte, addr string) (time.Time, error) + type NetTransport struct + func NewNetTransport(config *NetTransportConfig) (*NetTransport, error) + func (t *NetTransport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error) + func (t *NetTransport) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error) + func (t *NetTransport) GetAutoBindPort() int + func (t *NetTransport) PacketCh() <-chan *Packet + func (t *NetTransport) Shutdown() error + func (t *NetTransport) StreamCh() <-chan net.Conn + func (t *NetTransport) WriteTo(b []byte, addr string) (time.Time, error) + type NetTransportConfig struct + BindAddrs []string + BindPort int + Logger *log.Logger + type NoPingResponseError struct + func (f NoPingResponseError) Error() string + type Node struct + Addr net.IP + DCur uint8 + DMax uint8 + DMin uint8 + Meta []byte + Name string + PCur uint8 + PMax uint8 + PMin uint8 + Port uint16 + func (n *Node) Address() string + type NodeEvent struct + Event NodeEventType + Node *Node + type NodeEventType int + const NodeJoin + const NodeLeave + const NodeUpdate + type Packet struct + Buf []byte + From net.Addr + Timestamp time.Time + type PingDelegate interface + AckPayload func() []byte + NotifyPingComplete func(other *Node, rtt time.Duration, payload []byte) + type TransmitLimitedQueue struct + NumNodes func() int + RetransmitMult int + func (q *TransmitLimitedQueue) GetBroadcasts(overhead, limit int) [][]byte + func (q *TransmitLimitedQueue) NumQueued() int + func (q *TransmitLimitedQueue) Prune(maxRetain int) + func (q *TransmitLimitedQueue) QueueBroadcast(b Broadcast) + func (q *TransmitLimitedQueue) Reset() + type Transport interface + DialTimeout func(addr string, timeout time.Duration) (net.Conn, error) + FinalAdvertiseAddr func(ip string, port int) (net.IP, int, error) + PacketCh func() <-chan *Packet + Shutdown func() error + StreamCh func() <-chan net.Conn + WriteTo func(b []byte, addr string) (time.Time, error)