@cryptotaxi247 / kubo / commits / d77a9e69f

client/rpc!: remove deprecated DHT commands

Henrique Dias committed Feb 27, 2024 at 14:59 UTC d77a9e69f792f643b11df7c2ccf54372559c576e
7 files changed +5 -108
client/rpc/api.go
-6
@@ -227,12 +227,6 @@ func (api *HttpApi) Object() iface.ObjectAPI {
227 return (*ObjectAPI)(api)
228 }
229
230 -// nolint deprecated
231 -// Deprecated: use [HttpApi.Routing] instead.
232 -func (api *HttpApi) Dht() iface.DhtAPI {
233 - return (*DhtAPI)(api)
234 -}
235 -
230 func (api *HttpApi) Swarm() iface.SwarmAPI {
231 return (*SwarmAPI)(api)
232 }
client/rpc/dht.go deleted
-33
@@ -1,33 +0,0 @@
1 -package rpc
2 -
3 -import (
4 - "context"
5 -
6 - "github.com/ipfs/boxo/path"
7 - caopts "github.com/ipfs/kubo/core/coreiface/options"
8 - "github.com/libp2p/go-libp2p/core/peer"
9 -)
10 -
11 -type DhtAPI HttpApi
12 -
13 -// nolint deprecated
14 -// Deprecated: use [RoutingAPI.FindPeer] instead.
15 -func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) {
16 - return api.core().Routing().FindPeer(ctx, p)
17 -}
18 -
19 -// nolint deprecated
20 -// Deprecated: use [RoutingAPI.FindProviders] instead.
21 -func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) {
22 - return api.core().Routing().FindProviders(ctx, p, opts...)
23 -}
24 -
25 -// nolint deprecated
26 -// Deprecated: use [RoutingAPI.Provide] instead.
27 -func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error {
28 - return api.core().Routing().Provide(ctx, p, opts...)
29 -}
30 -
31 -func (api *DhtAPI) core() *HttpApi {
32 - return (*HttpApi)(api)
33 -}
core/coreapi/coreapi.go
-6
@@ -130,12 +130,6 @@ func (api *CoreAPI) Pin() coreiface.PinAPI {
130 return (*PinAPI)(api)
131 }
132
133 -// nolint deprecated
134 -// Deprecated: use [CoreAPI.Routing] instead.
135 -func (api *CoreAPI) Dht() coreiface.DhtAPI {
136 - return (*DhtAPI)(api)
137 -}
138 -
133 // Swarm returns the SwarmAPI interface implementation backed by the go-ipfs node
134 func (api *CoreAPI) Swarm() coreiface.SwarmAPI {
135 return (*SwarmAPI)(api)
core/coreapi/dht.go deleted
-34
@@ -1,34 +0,0 @@
1 -package coreapi
2 -
3 -import (
4 - "context"
5 -
6 - "github.com/ipfs/boxo/path"
7 - coreiface "github.com/ipfs/kubo/core/coreiface"
8 - caopts "github.com/ipfs/kubo/core/coreiface/options"
9 - peer "github.com/libp2p/go-libp2p/core/peer"
10 -)
11 -
12 -type DhtAPI CoreAPI
13 -
14 -// nolint deprecated
15 -// Deprecated: use [RoutingAPI.FindPeer] instead.
16 -func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) {
17 - return api.core().Routing().FindPeer(ctx, p)
18 -}
19 -
20 -// nolint deprecated
21 -// Deprecated: use [RoutingAPI.FindProviders] instead.
22 -func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) {
23 - return api.core().Routing().FindProviders(ctx, p, opts...)
24 -}
25 -
26 -// nolint deprecated
27 -// Deprecated: use [RoutingAPI.Provide] instead.
28 -func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error {
29 - return api.core().Routing().Provide(ctx, p, opts...)
30 -}
31 -
32 -func (api *DhtAPI) core() coreiface.CoreAPI {
33 - return (*CoreAPI)(api)
34 -}
core/coreiface/coreapi.go
-4
@@ -34,10 +34,6 @@ type CoreAPI interface {
34 // Object returns an implementation of Object API
35 Object() ObjectAPI
36
37 - // nolint deprecated
38 - // Deprecated: use [Routing] instead.
39 - Dht() DhtAPI
40 -
37 // Swarm returns an implementation of Swarm API
38 Swarm() SwarmAPI
39
core/coreiface/dht.go deleted
-25
@@ -1,25 +0,0 @@
1 -package iface
2 -
3 -import (
4 - "context"
5 -
6 - "github.com/ipfs/boxo/path"
7 - "github.com/ipfs/kubo/core/coreiface/options"
8 - "github.com/libp2p/go-libp2p/core/peer"
9 -)
10 -
11 -// nolint deprecated
12 -// Deprecated: use [RoutingAPI] instead.
13 -type DhtAPI interface {
14 - // nolint deprecated
15 - // Deprecated: use [RoutingAPI.FindPeer] instead.
16 - FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
17 -
18 - // nolint deprecated
19 - // Deprecated: use [RoutingAPI.FindProviders] instead.
20 - FindProviders(context.Context, path.Path, ...options.DhtFindProvidersOption) (<-chan peer.AddrInfo, error)
21 -
22 - // nolint deprecated
23 - // Deprecated: use [RoutingAPI.Provide] instead.
24 - Provide(context.Context, path.Path, ...options.DhtProvideOption) error
25 -}
docs/changelogs/v0.28.md
+5
@@ -6,6 +6,7 @@
6
7 - [Overview](#overview)
8 - [🔦 Highlights](#-highlights)
9 + - [RPC client: removed deprecated DHT API](#rpc-client-removed-deprecated-dht-api)
10 - [📝 Changelog](#-changelog)
11 - [👨‍👩‍👧‍👦 Contributors](#-contributors)
12
@@ -13,6 +14,10 @@
14
15 ### 🔦 Highlights
16
17 +#### RPC client: removed deprecated DHT API
18 +
19 +The deprecated DHT API commands in the RPC client have been removed. Instead, use the Routing API.
20 +
21 ### 📝 Changelog
22
23 ### 👨‍👩‍👧‍👦 Contributors