Versions in this module Expand all Collapse all v0 v0.1.2 May 23, 2024 v0.1.1 May 23, 2024 Changes in this version type Config + MetaData any v0.1.0 May 23, 2024 Changes in this version + type Config struct + BindAddr string + BindPort uint16 + EventListener Listener + IndirectChecks int + Name string + PiggyBackLimit int + PingInterval time.Duration + PingTimeout time.Duration + TCPTimeout time.Duration + Transport Transport + func DefaultLocalConfig() *Config + type Gossip struct + Gt gossipType + Node Node + type Listener interface + OnMembershipChange func(peer Node) + type Member struct + func Create(conf *Config) (*Member, error) + func (m *Member) AllNodes() []Node + func (m *Member) Join(addr string, data any) error + func (m *Member) Leave(timeout time.Duration) error + func (m *Member) Shutdown() error + func (m *Member) TotalNodes() int + type NetTransport struct + func NewNetTransport(addr string, port uint16) (*NetTransport, error) + func (n *NetTransport) DialAndConnect(addr string, timeout time.Duration) (net.Conn, error) + func (n *NetTransport) Packets() <-chan *Packet + func (n *NetTransport) SendTo(b []byte, addr string) error + func (n *NetTransport) Shutdown() error + func (n *NetTransport) Stream() <-chan net.Conn + type Node struct + Addr string + Data any + Name string + Port uint16 + State StateType + func (n *Node) String() string + type Packet struct + Buf []byte + From net.Addr + type StateType int + const Alive + const Dead + const Left + type Transport interface + DialAndConnect func(addr string, timeout time.Duration) (net.Conn, error) + Packets func() <-chan *Packet + SendTo func(b []byte, addr string) error + Shutdown func() error + Stream func() <-chan net.Conn