mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-05-28 13:41:20 +00:00
providers: add some documentation
This commit is contained in:
parent
24c3841189
commit
3c9d044798
@ -312,6 +312,7 @@ func (pm *ProviderManager) run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddProvider adds a provider.
|
||||||
func (pm *ProviderManager) AddProvider(ctx context.Context, k cid.Cid, val peer.ID) {
|
func (pm *ProviderManager) AddProvider(ctx context.Context, k cid.Cid, val peer.ID) {
|
||||||
prov := &addProv{
|
prov := &addProv{
|
||||||
k: k,
|
k: k,
|
||||||
@ -323,6 +324,8 @@ func (pm *ProviderManager) AddProvider(ctx context.Context, k cid.Cid, val peer.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetProviders returns the set of providers for the given key.
|
||||||
|
// This method _does not_ copy the set. Do not modify it.
|
||||||
func (pm *ProviderManager) GetProviders(ctx context.Context, k cid.Cid) []peer.ID {
|
func (pm *ProviderManager) GetProviders(ctx context.Context, k cid.Cid) []peer.ID {
|
||||||
gp := &getProv{
|
gp := &getProv{
|
||||||
k: k,
|
k: k,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user