Documentation ¶
Index ¶
- type ClusterMeshAPIServerData
- type Delegate
- func (d *Delegate) GetBroadcasts(overhead, limit int) [][]byte
- func (d *Delegate) LocalState(join bool) []byte
- func (d *Delegate) MergeRemoteState(buf []byte, join bool)
- func (d *Delegate) NodeMeta(limit int) []byte
- func (e *Delegate) NotifyJoin(node *memberlist.Node)
- func (e *Delegate) NotifyLeave(node *memberlist.Node)
- func (d *Delegate) NotifyMsg(msg []byte)
- func (e *Delegate) NotifyUpdate(node *memberlist.Node)
- type NodeMeta
- type Server
- type ServerOptions
- type TCPTransport
- func (t *TCPTransport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error)
- func (t *TCPTransport) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error)
- func (t *TCPTransport) GetAutoBindPort() int
- func (t *TCPTransport) PacketCh() <-chan *memberlist.Packet
- func (t *TCPTransport) Shutdown() error
- func (t *TCPTransport) StreamCh() <-chan net.Conn
- func (t *TCPTransport) WriteTo(b []byte, addr string) (time.Time, error)
- type TCPTransportConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterMeshAPIServerData ¶
type ClusterMeshAPIServerData struct {
ClusterName string
}
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func NewDelegate(logger *zap.Logger, meshState *state.ClusterMeshState) *Delegate
func (*Delegate) GetBroadcasts ¶
func (*Delegate) LocalState ¶
func (*Delegate) MergeRemoteState ¶
func (*Delegate) NotifyJoin ¶
func (e *Delegate) NotifyJoin(node *memberlist.Node)
func (*Delegate) NotifyLeave ¶
func (e *Delegate) NotifyLeave(node *memberlist.Node)
func (*Delegate) NotifyUpdate ¶
func (e *Delegate) NotifyUpdate(node *memberlist.Node)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ServerOptions, logger *zap.Logger, meshState *state.ClusterMeshState, clientSet *kubernetes.Clientset) *Server
type ServerOptions ¶
type TCPTransport ¶
type TCPTransport struct {
// contains filtered or unexported fields
}
Copied and edited from distributed systems kit from grafana https://github.com/grafana/dskit/blob/main/kv/memberlist/tcp_transport.go TCPTransport is a memberlist.Transport implementation that uses TCP for both packet and stream operations ("packet" and "stream" are terms used by memberlist). It uses a new TCP connections for each operation. There is no connection reuse.
func NewTCPTransport ¶
func NewTCPTransport(config TCPTransportConfig, logger *zap.Logger) (*TCPTransport, error)
NewTCPTransport returns a new tcp-based transport with the given configuration. On success all the network listeners will be created and listening.
func (*TCPTransport) DialTimeout ¶
DialTimeout is used to create a connection that allows memberlist to perform two-way communication with a peer.
func (*TCPTransport) FinalAdvertiseAddr ¶
FinalAdvertiseAddr is given the user's configured values (which might be empty) and returns the desired IP and port to advertise to the rest of the cluster. (Copied from memberlist' net_transport.go)
func (*TCPTransport) GetAutoBindPort ¶
func (t *TCPTransport) GetAutoBindPort() int
GetAutoBindPort returns the bind port that was automatically given by the kernel, if a bind port of 0 was given.
func (*TCPTransport) PacketCh ¶
func (t *TCPTransport) PacketCh() <-chan *memberlist.Packet
PacketCh returns a channel that can be read to receive incoming packets from other peers.
func (*TCPTransport) Shutdown ¶
func (t *TCPTransport) Shutdown() error
Shutdown is called when memberlist is shutting down; this gives the transport a chance to clean up any listeners.
func (*TCPTransport) StreamCh ¶
func (t *TCPTransport) StreamCh() <-chan net.Conn
StreamCh returns a channel that can be read to handle incoming stream connections from other peers.