Versions in this module Expand all Collapse all v0 v0.2.3 Feb 27, 2015 v0.2.2 Feb 27, 2015 Changes in this version + var DialTimeout time.Duration = time.Second * 10 + var ErrDialBackoff = errors.New("dial backoff") + var ErrDialFailed = errors.New("dial attempt failed") + var ErrDialToSelf = errors.New("dial to self attempted") + var PSTransport = psy.DefaultTransport + type Conn ps.Conn + func (c *Conn) Close() error + func (c *Conn) LocalMultiaddr() ma.Multiaddr + func (c *Conn) LocalPeer() peer.ID + func (c *Conn) LocalPrivateKey() ic.PrivKey + func (c *Conn) NewStream() (inet.Stream, error) + func (c *Conn) NewSwarmStream() (*Stream, error) + func (c *Conn) RawConn() conn.Conn + func (c *Conn) RemoteMultiaddr() ma.Multiaddr + func (c *Conn) RemotePeer() peer.ID + func (c *Conn) RemotePublicKey() ic.PubKey + func (c *Conn) StreamConn() *ps.Conn + func (c *Conn) String() string + type ConnHandler func(*Conn) + type Network Swarm + func NewNetwork(ctx context.Context, listen []ma.Multiaddr, local peer.ID, ...) (*Network, error) + func (n *Network) Close() error + func (n *Network) ClosePeer(p peer.ID) error + func (n *Network) Connectedness(p peer.ID) inet.Connectedness + func (n *Network) Conns() []inet.Conn + func (n *Network) ConnsToPeer(p peer.ID) []inet.Conn + func (n *Network) CtxGroup() ctxgroup.ContextGroup + func (n *Network) DialPeer(ctx context.Context, p peer.ID) (inet.Conn, error) + func (n *Network) InterfaceListenAddresses() ([]ma.Multiaddr, error) + func (n *Network) Listen(addrs ...ma.Multiaddr) error + func (n *Network) ListenAddresses() []ma.Multiaddr + func (n *Network) LocalPeer() peer.ID + func (n *Network) NewStream(p peer.ID) (inet.Stream, error) + func (n *Network) Notify(f inet.Notifiee) + func (n *Network) Peers() []peer.ID + func (n *Network) Peerstore() peer.Peerstore + func (n *Network) SetConnHandler(h inet.ConnHandler) + func (n *Network) SetStreamHandler(h inet.StreamHandler) + func (n *Network) StopNotify(f inet.Notifiee) + func (n *Network) String() string + func (n *Network) Swarm() *Swarm + type Stream ps.Stream + func (s *Stream) Close() error + func (s *Stream) Conn() inet.Conn + func (s *Stream) Read(p []byte) (n int, err error) + func (s *Stream) Stream() *ps.Stream + func (s *Stream) SwarmConn() *Conn + func (s *Stream) Write(p []byte) (n int, err error) + type Swarm struct + func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr, local peer.ID, ...) (*Swarm, error) + func (s *Swarm) Close() error + func (s *Swarm) CloseConnection(p peer.ID) error + func (s *Swarm) Connections() []*Conn + func (s *Swarm) ConnectionsToPeer(p peer.ID) []*Conn + func (s *Swarm) CtxGroup() ctxgroup.ContextGroup + func (s *Swarm) Dial(ctx context.Context, p peer.ID) (*Conn, error) + func (s *Swarm) InterfaceListenAddresses() ([]ma.Multiaddr, error) + func (s *Swarm) Listen(addrs ...ma.Multiaddr) error + func (s *Swarm) ListenAddresses() []ma.Multiaddr + func (s *Swarm) LocalPeer() peer.ID + func (s *Swarm) NewStreamWithPeer(p peer.ID) (*Stream, error) + func (s *Swarm) Notify(f inet.Notifiee) + func (s *Swarm) Peers() []peer.ID + func (s *Swarm) SetConnHandler(handler ConnHandler) + func (s *Swarm) SetStreamHandler(handler inet.StreamHandler) + func (s *Swarm) StopNotify(f inet.Notifiee) + func (s *Swarm) StreamSwarm() *ps.Swarm + func (s *Swarm) StreamsWithPeer(p peer.ID) []*Stream