Documentation ¶
Index ¶
- Constants
- type RoutedHost
- func (rh *RoutedHost) Addrs() []ma.Multiaddr
- func (rh *RoutedHost) Close() error
- func (rh *RoutedHost) Connect(ctx context.Context, pi peer.PeerInfo) error
- func (rh *RoutedHost) ID() peer.ID
- func (rh *RoutedHost) Mux() *protocol.Mux
- func (rh *RoutedHost) Network() inet.Network
- func (rh *RoutedHost) NewStream(pid protocol.ID, p peer.ID) (inet.Stream, error)
- func (rh *RoutedHost) Peerstore() peer.Peerstore
- func (rh *RoutedHost) RemoveStreamHandler(pid protocol.ID)
- func (rh *RoutedHost) SetStreamHandler(pid protocol.ID, handler inet.StreamHandler)
Constants ¶
View Source
const AddressTTL = time.Second * 10
AddressTTL is the expiry time for our addresses. We expire them quickly.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoutedHost ¶
type RoutedHost struct {
// contains filtered or unexported fields
}
RoutedHost is a p2p Host that includes a routing system. This allows the Host to find the addresses for peers when it does not have them.
func Wrap ¶
func Wrap(h host.Host, r routing.IpfsRouting) *RoutedHost
func (*RoutedHost) Addrs ¶
func (rh *RoutedHost) Addrs() []ma.Multiaddr
func (*RoutedHost) Close ¶
func (rh *RoutedHost) Close() error
func (*RoutedHost) Connect ¶
Connect ensures there is a connection between this host and the peer with given peer.ID. See (host.Host).Connect for more information.
RoutedHost's Connect differs in that if the host has no addresses for a given peer, it will use its routing system to try to find some.
func (*RoutedHost) ID ¶
func (rh *RoutedHost) ID() peer.ID
func (*RoutedHost) Mux ¶
func (rh *RoutedHost) Mux() *protocol.Mux
func (*RoutedHost) Network ¶
func (rh *RoutedHost) Network() inet.Network
func (*RoutedHost) Peerstore ¶
func (rh *RoutedHost) Peerstore() peer.Peerstore
func (*RoutedHost) RemoveStreamHandler ¶
func (rh *RoutedHost) RemoveStreamHandler(pid protocol.ID)
func (*RoutedHost) SetStreamHandler ¶
func (rh *RoutedHost) SetStreamHandler(pid protocol.ID, handler inet.StreamHandler)
Click to show internal directories.
Click to hide internal directories.