Documentation ¶
Index ¶
- Variables
- type FullRT
- func (dht *FullRT) Bootstrap(ctx context.Context) error
- func (dht *FullRT) CheckPeers(ctx context.Context, peers ...peer.ID) (int, int)
- func (dht *FullRT) Close() error
- func (dht *FullRT) FindLocal(id peer.ID) peer.AddrInfo
- func (dht *FullRT) FindPeer(ctx context.Context, id peer.ID) (_ peer.AddrInfo, err error)
- func (dht *FullRT) FindProviders(ctx context.Context, c cid.Cid) ([]peer.AddrInfo, error)
- func (dht *FullRT) FindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo
- func (dht *FullRT) GetClosestPeers(ctx context.Context, key string) ([]peer.ID, error)
- func (dht *FullRT) GetValue(ctx context.Context, key string, opts ...routing.Option) (_ []byte, err error)
- func (dht *FullRT) Host() host.Host
- func (dht *FullRT) Provide(ctx context.Context, key cid.Cid, brdcst bool) (err error)
- func (dht *FullRT) ProvideMany(ctx context.Context, keys []multihash.Multihash) error
- func (dht *FullRT) PutMany(ctx context.Context, keys []string, values [][]byte) error
- func (dht *FullRT) PutValue(ctx context.Context, key string, value []byte, opts ...routing.Option) (err error)
- func (dht *FullRT) Ready() bool
- func (dht *FullRT) SearchValue(ctx context.Context, key string, opts ...routing.Option) (<-chan []byte, error)
- func (dht *FullRT) Stat() map[string]peer.ID
- func (dht *FullRT) TriggerRefresh(ctx context.Context) error
- type Option
- type RecvdVal
Constants ¶
This section is empty.
Variables ¶
var Tracer = otel.Tracer("")
Functions ¶
This section is empty.
Types ¶
type FullRT ¶
type FullRT struct { Validator record.Validator ProviderManager *providers.ProviderManager // contains filtered or unexported fields }
FullRT is an experimental DHT client that is under development. Expect breaking changes to occur in this client until it stabilizes.
func NewFullRT ¶
NewFullRT creates a DHT client that tracks the full network. It takes a protocol prefix for the given network, For example, the protocol /ipfs/kad/1.0.0 has the prefix /ipfs.
FullRT is an experimental DHT client that is under development. Expect breaking changes to occur in this client until it stabilizes.
Not all of the standard DHT options are supported in this DHT.
func (*FullRT) CheckPeers ¶
CheckPeers return (success, total)
func (*FullRT) FindLocal ¶
FindLocal looks for a peer with a given ID connected to this dht and returns the peer and the table it was found in.
func (*FullRT) FindProviders ¶
FindProviders searches until the context expires.
func (*FullRT) FindProvidersAsync ¶
func (dht *FullRT) FindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo
FindProvidersAsync is the same thing as FindProviders, but returns a channel. Peers will be returned on the channel as soon as they are found, even before the search query completes. If count is zero then the query will run until it completes. Note: not reading from the returned channel may block the query from progressing.
func (*FullRT) GetClosestPeers ¶
func (*FullRT) GetValue ¶
func (dht *FullRT) GetValue(ctx context.Context, key string, opts ...routing.Option) (_ []byte, err error)
GetValue searches for the value corresponding to given Key.
func (*FullRT) Provide ¶
Provide makes this node announce that it can provide a value for the given key
func (*FullRT) ProvideMany ¶
func (*FullRT) PutValue ¶
func (dht *FullRT) PutValue(ctx context.Context, key string, value []byte, opts ...routing.Option) (err error)
PutValue adds value corresponding to given Key. This is the top level "Store" operation of the DHT