peers

package
v0.0.0-...-f5f0bdb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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

func (n *Notifiee) ClosedStream(net inet.Network, stream inet.Stream)

ClosedStream ...

func (*Notifiee) Connected

func (n *Notifiee) Connected(net inet.Network, conn inet.Conn)

Connected ...

func (*Notifiee) Disconnected

func (n *Notifiee) Disconnected(net inet.Network, conn inet.Conn)

Disconnected ...

func (*Notifiee) Listen

func (n *Notifiee) Listen(net inet.Network, addr ma.Multiaddr)

Listen ...

func (*Notifiee) ListenClose

func (n *Notifiee) ListenClose(net inet.Network, addr ma.Multiaddr)

ListenClose ...

func (*Notifiee) OpenedStream

func (n *Notifiee) OpenedStream(net inet.Network, stream inet.Stream)

OpenedStream ...

type Peers

type Peers struct {
	Store         pstore.Peerstore
	KnownPeersMap map[libpeer.ID]*clienttypes.KnownPeer
	// contains filtered or unexported fields
}

Peers ...

func New

New ...

func (*Peers) Add

Add ...

func (*Peers) Count

func (p *Peers) Count() (uint, error)

Count returns the number of connected peers

func (*Peers) CountAll

func (p *Peers) CountAll() (uint, error)

CountAll returns the number of known peers

func (*Peers) Get

Get returns a peer

func (*Peers) GetFromID

func (p *Peers) GetFromID(id libpeer.ID) (*clienttypes.KnownPeer, error)

GetFromID ...

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

On handles peers events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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