Versions in this module Expand all Collapse all v1 v1.0.0 Jul 3, 2023 Changes in this version + func InitHost(ctx context.Context, opts []libp2p.Option, listenAddrs ...multiaddr.Multiaddr) (host.Host, error) + type BitswapClient struct + func NewBitswapClient(host host.Host, timeout time.Duration) BitswapClient + func (c BitswapClient) Retrieve(parent context.Context, target peer.AddrInfo, cid cid.Cid) (*task.RetrievalResult, error) + type GraphsyncClient struct + func NewGraphsyncClient(host host.Host, timeout time.Duration) GraphsyncClient + func (c GraphsyncClient) Retrieve(parent context.Context, target peer.AddrInfo, cid cid.Cid) (*task.RetrievalResult, error) + type HTTPClient struct + func NewHTTPClient(timeout time.Duration) HTTPClient + func (c HTTPClient) RetrievePiece(parent context.Context, host string, cid cid.Cid, length int64) (*task.RetrievalResult, error) + type MessageReceiver struct + BSClient *bsclient.Client + MessageHandler func(ctx context.Context, sender peer.ID, incoming bsmsg.BitSwapMessage) + func (m MessageReceiver) PeerConnected(id peer.ID) + func (m MessageReceiver) PeerDisconnected(id peer.ID) + func (m MessageReceiver) ReceiveError(err error) + func (m MessageReceiver) ReceiveMessage(ctx context.Context, sender peer.ID, incoming bsmsg.BitSwapMessage) + type SingleContentRouter struct + AddrInfo peer.AddrInfo + func (s SingleContentRouter) Bootstrap(context.Context) error + func (s SingleContentRouter) Close() error + func (s SingleContentRouter) FindPeer(context.Context, peer.ID) (peer.AddrInfo, error) + func (s SingleContentRouter) FindProvidersAsync(context.Context, cid.Cid, int) <-chan peer.AddrInfo + func (s SingleContentRouter) GetValue(context.Context, string, ...routing.Option) ([]byte, error) + func (s SingleContentRouter) Provide(context.Context, cid.Cid, bool) error + func (s SingleContentRouter) PutValue(context.Context, string, []byte, ...routing.Option) error + func (s SingleContentRouter) SearchValue(ctx context.Context, key string, opts ...routing.Option) (<-chan []byte, error) + type TimeCounter struct + func NewTimeCounter() *TimeCounter + func (tc *TimeCounter) Next() uint64