state

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionAlreadyEstablished = fmt.Errorf("already have a session with this peer")
)

Functions

This section is empty.

Types

type ConnectedClients

type ConnectedClients struct {
	Peer  uint64
	CRC64 uint64
	// contains filtered or unexported fields
}

ConnectedClients is used when memberlist does TCP push/pull state synchronization. It is used to notify the querying peer with a binary fuse filter.

func NewConnectedClients added in v0.6.0

func NewConnectedClients(peer uint64, clients []uint64) (*ConnectedClients, error)

func (*ConnectedClients) Has added in v0.6.0

func (c *ConnectedClients) Has(client uint64) bool

func (*ConnectedClients) MarshalBinary added in v0.6.0

func (c *ConnectedClients) MarshalBinary() ([]byte, error)

func (*ConnectedClients) UnmarshalBinary added in v0.6.0

func (c *ConnectedClients) UnmarshalBinary(b []byte) error

type PeerGraph

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

func NewPeerGraph

func NewPeerGraph(self uint64) *PeerGraph

func (*PeerGraph) Remove added in v0.6.0

func (p *PeerGraph) Remove(peer uint64)

func (*PeerGraph) Replace

func (p *PeerGraph) Replace(c ConnectedClients) (modified bool)

func (*PeerGraph) Who added in v0.6.0

func (p *PeerGraph) Who(client uint64) (peer uint64)

type PeerMap

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

PeerMap maintains the mapping between a Peer and their corresponding *multiplexer.Peer connection. Although Peers are discovered via gossip, who gets to initiate the connection is decided by the ordinality of their PeerIDs. If they happened to have the same PeerID, they will panic to restart.

func NewPeerMap

func NewPeerMap(logger *zap.Logger, self uint64) *PeerMap

func (*PeerMap) CRC64 added in v0.6.0

func (s *PeerMap) CRC64() uint64

func (*PeerMap) Get

func (s *PeerMap) Get(peer uint64) multiplexer.Peer

func (*PeerMap) Has

func (s *PeerMap) Has(peer uint64) bool

func (*PeerMap) Len

func (s *PeerMap) Len() int

func (*PeerMap) NewPeer

func (s *PeerMap) NewPeer(ctx context.Context, proto protocol.Protocol, conf multiplexer.Config) error

func (*PeerMap) Notify

func (s *PeerMap) Notify() <-chan multiplexer.Peer

func (*PeerMap) Print

func (s *PeerMap) Print()

func (*PeerMap) Remove

func (s *PeerMap) Remove(peer uint64) error

func (*PeerMap) Snapshot

func (s *PeerMap) Snapshot() []uint64

Jump to

Keyboard shortcuts

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