Documentation ¶
Index ¶
- Variables
- type DiscoveryNotifee
- type Notifiee
- func (n *Notifiee) ClosedStream(net inet.Network, stream inet.Stream)
- func (n *Notifiee) Connected(net inet.Network, conn inet.Conn)
- func (n *Notifiee) Disconnected(net inet.Network, conn inet.Conn)
- func (n *Notifiee) Listen(net inet.Network, addr ma.Multiaddr)
- func (n *Notifiee) ListenClose(net inet.Network, addr ma.Multiaddr)
- func (n *Notifiee) OpenedStream(net inet.Network, stream inet.Stream)
- type Peers
- func (p *Peers) Add(pi pstore.PeerInfo) (*clienttypes.KnownPeer, error)
- func (p *Peers) Count() (uint, error)
- func (p *Peers) CountAll() (uint, error)
- func (p *Peers) Get(pi pstore.PeerInfo) (*clienttypes.KnownPeer, error)
- func (p *Peers) GetFromID(id libpeer.ID) (*clienttypes.KnownPeer, error)
- func (p *Peers) KnownPeers() ([]*clienttypes.KnownPeer, error)
- func (p *Peers) Log(event peerstypes.EventEnum, iface interface{}) error
- func (p *Peers) On(event peerstypes.EventEnum, cb clienttypes.PeersEventCallback)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoStore ... // TODO: change to nil store ErrNoStore = errors.New("no peer store") // ErrNoConfig ... // TODO: change to nil config ErrNoConfig = errors.New("no config") // ErrNoPeerMap ... // TODO: change to nil peer map ErrNoPeerMap = errors.New("no peer map") // ErrNoSuchPeer ... ErrNoSuchPeer = errors.New("no such peer") // ErrNilEvent ... ErrNilEvent = errors.New("nil event") // ErrNilChain ... ErrNilChain = errors.New("nil chain") )
Functions ¶
This section is empty.
Types ¶
type DiscoveryNotifee ¶
type DiscoveryNotifee struct {
// contains filtered or unexported fields
}
DiscoveryNotifee ...
func (*DiscoveryNotifee) HandlePeerFound ¶
func (d *DiscoveryNotifee) HandlePeerFound(pi peerstore.PeerInfo)
HandlePeerFound ...
type Notifiee ¶
type Notifiee struct {
// contains filtered or unexported fields
}
Notifiee ... TODO: make private?
func (*Notifiee) ClosedStream ¶
ClosedStream ...
func (*Notifiee) Disconnected ¶
Disconnected ...
func (*Notifiee) ListenClose ¶
ListenClose ...
type Peers ¶
type Peers struct { Store pstore.Peerstore KnownPeersMap map[libpeer.ID]*clienttypes.KnownPeer // contains filtered or unexported fields }
Peers ...
func New ¶
func New(cfg *clienttypes.ConfigClient, chn clienttypes.InterfaceChains, host libp2pHost.Host) (*Peers, error)
New ...
func (*Peers) KnownPeers ¶
func (p *Peers) KnownPeers() ([]*clienttypes.KnownPeer, error)
KnownPeers returns the peers
func (*Peers) Log ¶
func (p *Peers) Log(event peerstypes.EventEnum, iface interface{}) error
Log ...
func (*Peers) On ¶
func (p *Peers) On(event peerstypes.EventEnum, cb clienttypes.PeersEventCallback)
On handles peers events
Click to show internal directories.
Click to hide internal directories.