mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-24 02:20:52 +08:00
client/rpc!: remove deprecated DHT commands
This commit is contained in:
@ -227,12 +227,6 @@ func (api *HttpApi) Object() iface.ObjectAPI {
|
||||
return (*ObjectAPI)(api)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [HttpApi.Routing] instead.
|
||||
func (api *HttpApi) Dht() iface.DhtAPI {
|
||||
return (*DhtAPI)(api)
|
||||
}
|
||||
|
||||
func (api *HttpApi) Swarm() iface.SwarmAPI {
|
||||
return (*SwarmAPI)(api)
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ipfs/boxo/path"
|
||||
caopts "github.com/ipfs/kubo/core/coreiface/options"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
)
|
||||
|
||||
type DhtAPI HttpApi
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindPeer] instead.
|
||||
func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) {
|
||||
return api.core().Routing().FindPeer(ctx, p)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindProviders] instead.
|
||||
func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) {
|
||||
return api.core().Routing().FindProviders(ctx, p, opts...)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.Provide] instead.
|
||||
func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error {
|
||||
return api.core().Routing().Provide(ctx, p, opts...)
|
||||
}
|
||||
|
||||
func (api *DhtAPI) core() *HttpApi {
|
||||
return (*HttpApi)(api)
|
||||
}
|
@ -130,12 +130,6 @@ func (api *CoreAPI) Pin() coreiface.PinAPI {
|
||||
return (*PinAPI)(api)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [CoreAPI.Routing] instead.
|
||||
func (api *CoreAPI) Dht() coreiface.DhtAPI {
|
||||
return (*DhtAPI)(api)
|
||||
}
|
||||
|
||||
// Swarm returns the SwarmAPI interface implementation backed by the go-ipfs node
|
||||
func (api *CoreAPI) Swarm() coreiface.SwarmAPI {
|
||||
return (*SwarmAPI)(api)
|
||||
|
@ -1,34 +0,0 @@
|
||||
package coreapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ipfs/boxo/path"
|
||||
coreiface "github.com/ipfs/kubo/core/coreiface"
|
||||
caopts "github.com/ipfs/kubo/core/coreiface/options"
|
||||
peer "github.com/libp2p/go-libp2p/core/peer"
|
||||
)
|
||||
|
||||
type DhtAPI CoreAPI
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindPeer] instead.
|
||||
func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) {
|
||||
return api.core().Routing().FindPeer(ctx, p)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindProviders] instead.
|
||||
func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) {
|
||||
return api.core().Routing().FindProviders(ctx, p, opts...)
|
||||
}
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.Provide] instead.
|
||||
func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error {
|
||||
return api.core().Routing().Provide(ctx, p, opts...)
|
||||
}
|
||||
|
||||
func (api *DhtAPI) core() coreiface.CoreAPI {
|
||||
return (*CoreAPI)(api)
|
||||
}
|
@ -34,10 +34,6 @@ type CoreAPI interface {
|
||||
// Object returns an implementation of Object API
|
||||
Object() ObjectAPI
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [Routing] instead.
|
||||
Dht() DhtAPI
|
||||
|
||||
// Swarm returns an implementation of Swarm API
|
||||
Swarm() SwarmAPI
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
package iface
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ipfs/boxo/path"
|
||||
"github.com/ipfs/kubo/core/coreiface/options"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
)
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI] instead.
|
||||
type DhtAPI interface {
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindPeer] instead.
|
||||
FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.FindProviders] instead.
|
||||
FindProviders(context.Context, path.Path, ...options.DhtFindProvidersOption) (<-chan peer.AddrInfo, error)
|
||||
|
||||
// nolint deprecated
|
||||
// Deprecated: use [RoutingAPI.Provide] instead.
|
||||
Provide(context.Context, path.Path, ...options.DhtProvideOption) error
|
||||
}
|
@ -6,6 +6,7 @@
|
||||
|
||||
- [Overview](#overview)
|
||||
- [🔦 Highlights](#-highlights)
|
||||
- [RPC client: removed deprecated DHT API](#rpc-client-removed-deprecated-dht-api)
|
||||
- [📝 Changelog](#-changelog)
|
||||
- [👨👩👧👦 Contributors](#-contributors)
|
||||
|
||||
@ -13,6 +14,10 @@
|
||||
|
||||
### 🔦 Highlights
|
||||
|
||||
#### RPC client: removed deprecated DHT API
|
||||
|
||||
The deprecated DHT API commands in the RPC client have been removed. Instead, use the Routing API.
|
||||
|
||||
### 📝 Changelog
|
||||
|
||||
### 👨👩👧👦 Contributors
|
||||
|
Reference in New Issue
Block a user