net

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0, MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitHost

func InitHost(ctx context.Context, opts []libp2p.Option, listenAddrs ...multiaddr.Multiaddr) (host.Host, error)

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

type SingleContentRouter struct {
	AddrInfo peer.AddrInfo
}

func (SingleContentRouter) Bootstrap

func (SingleContentRouter) Close

func (s SingleContentRouter) Close() error

func (SingleContentRouter) FindPeer

func (SingleContentRouter) FindProvidersAsync

func (s SingleContentRouter) FindProvidersAsync(context.Context, cid.Cid, int) <-chan peer.AddrInfo

func (SingleContentRouter) GetValue

func (SingleContentRouter) Provide

func (s SingleContentRouter) Provide(context.Context, cid.Cid, bool) error

func (SingleContentRouter) PutValue

func (SingleContentRouter) SearchValue

func (s SingleContentRouter) SearchValue(ctx context.Context, key string, opts ...routing.Option) (
	<-chan []byte, error)

type TimeCounter

type TimeCounter struct {
	// contains filtered or unexported fields
}

func NewTimeCounter

func NewTimeCounter() *TimeCounter

func (*TimeCounter) Next

func (tc *TimeCounter) Next() uint64

Jump to

Keyboard shortcuts

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