Documentation ¶
Index ¶
- func ParseCSVAddrs(csv string, port uint16) ([]string, error)
- func UniqTCPAddr(one string, all []string) (*net.TCPAddr, []*net.TCPAddr, error)
- type Delegate
- type Node
- type Sender
- func (s *Sender) Broadcast(msg []byte)
- func (s *Sender) Name() string
- func (s *Sender) Peer(name string) *Node
- func (s *Sender) Peers() []*Node
- func (s *Sender) Ping(name string) (time.Duration, error)
- func (s *Sender) Self() *Node
- func (s *Sender) SendBestEffort(name string, msg []byte)
- func (s *Sender) SendReliable(name string, msg []byte)
- func (s *Sender) UpdateMetadata(timeout time.Duration) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Delegate ¶
type Delegate interface { // GossipStarted give the sender to delegate // announce gossip server started GossipStarted(*Sender) // Metadata get local node meta data Metadata(limit int) []byte // NotifyJoin notify node join or node online NotifyJoin(*Node) // NotifyJoin notify node leave or node offline NotifyLeave(*Node) // NotifyUpdate notify node's metadata updated NotifyUpdate(*Node) // PingPayload given the payload push to other node while pinging. // And payload will be compress by lzw default, then aes encrypt optionally, // the final size must less than udp packet max size limit PingPayload() []byte // NotifyPing notify that other node pushed it's payload to me while pinging NotifyPing(other *Node, payload []byte) // NotifyMessage notify received message NotifyMessage(msg []byte) }
type Node ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func (*Sender) SendBestEffort ¶
func (*Sender) SendReliable ¶
type Server ¶
type Server struct { Config *memberlist.Config // contains filtered or unexported fields }
func (*Server) RegisterDelegate ¶
Click to show internal directories.
Click to hide internal directories.