Documentation ¶
Index ¶
- func InitHost(ctx context.Context, opts []libp2p.Option, listenAddrs ...multiaddr.Multiaddr) (host.Host, error)
- type BitswapClient
- type GraphsyncClient
- type HTTPClient
- type MessageReceiver
- type SingleContentRouter
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitswapClient ¶
type BitswapClient struct {
// contains filtered or unexported fields
}
func NewBitswapClient ¶
func NewBitswapClient(host host.Host, timeout time.Duration) BitswapClient
func (BitswapClient) Retrieve ¶
func (c BitswapClient) Retrieve( parent context.Context, target peer.AddrInfo, cid cid.Cid) (*task.RetrievalResult, error)
type GraphsyncClient ¶
type GraphsyncClient struct {
// contains filtered or unexported fields
}
func NewGraphsyncClient ¶
func NewGraphsyncClient(host host.Host, timeout time.Duration) GraphsyncClient
func (GraphsyncClient) Retrieve ¶
func (c GraphsyncClient) Retrieve( parent context.Context, target peer.AddrInfo, cid cid.Cid) (*task.RetrievalResult, error)
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(timeout time.Duration) HTTPClient
func (HTTPClient) RetrievePiece ¶
func (c HTTPClient) RetrievePiece( parent context.Context, host string, cid cid.Cid, length int64) (*task.RetrievalResult, error)
type MessageReceiver ¶
type MessageReceiver struct { BSClient *bsclient.Client MessageHandler func(ctx context.Context, sender peer.ID, incoming bsmsg.BitSwapMessage) }
func (MessageReceiver) PeerConnected ¶
func (m MessageReceiver) PeerConnected(id peer.ID)
func (MessageReceiver) PeerDisconnected ¶
func (m MessageReceiver) PeerDisconnected(id peer.ID)
func (MessageReceiver) ReceiveError ¶
func (m MessageReceiver) ReceiveError(err error)
func (MessageReceiver) ReceiveMessage ¶
func (m MessageReceiver) ReceiveMessage( ctx context.Context, sender peer.ID, incoming bsmsg.BitSwapMessage)
type SingleContentRouter ¶
func (SingleContentRouter) Bootstrap ¶
func (s SingleContentRouter) Bootstrap(context.Context) error
func (SingleContentRouter) Close ¶
func (s SingleContentRouter) Close() error
func (SingleContentRouter) FindProvidersAsync ¶
func (SingleContentRouter) Provide ¶
func (s SingleContentRouter) Provide(context.Context, cid.Cid, bool) error
func (SingleContentRouter) SearchValue ¶
type TimeCounter ¶
type TimeCounter struct {
// contains filtered or unexported fields
}
func NewTimeCounter ¶
func NewTimeCounter() *TimeCounter
func (*TimeCounter) Next ¶
func (tc *TimeCounter) Next() uint64
Click to show internal directories.
Click to hide internal directories.