Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit f8cfba2

Browse files
guseggerthacdias
authored andcommitted
chore: deprecate exported types
1 parent 6ecaba9 commit f8cfba2

28 files changed

+241
-4
lines changed

block.go

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
)
1111

1212
// BlockStat contains information about a block
13+
//
14+
// Deprecated: use github.com/ipfs/boxo/coreiface.BlockStat
1315
type BlockStat interface {
1416
// Size is the size of a block
1517
Size() int
@@ -19,6 +21,8 @@ type BlockStat interface {
1921
}
2022

2123
// BlockAPI specifies the interface to the block layer
24+
//
25+
// Deprecated: use github.com/ipfs/boxo/coreiface.BlockAPI
2226
type BlockAPI interface {
2327
// Put imports raw block data, hashing it using specified settings.
2428
Put(context.Context, io.Reader, ...options.BlockPutOption) (BlockStat, error)

coreapi.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
)
1414

1515
// CoreAPI defines an unified interface to IPFS for Go programs
16+
//
17+
// Deprecated: use github.com/ipfs/boxo/coreiface.CoreAPI
1618
type CoreAPI interface {
1719
// Unixfs returns an implementation of Unixfs API
1820
Unixfs() UnixfsAPI

dag.go

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
)
66

77
// APIDagService extends ipld.DAGService
8+
//
9+
// Deprecated: use github.com/ipfs/boxo/coreiface.APIDagService
810
type APIDagService interface {
911
ipld.DAGService
1012

dht.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
// DhtAPI specifies the interface to the DHT
1414
// Note: This API will likely get deprecated in near future, see
1515
// https://github.com/ipfs/interface-ipfs-core/issues/249 for more context.
16+
//
17+
// Deprecated: use github.com/ipfs/boxo/coreiface.DhtAPI
1618
type DhtAPI interface {
1719
// FindPeer queries the DHT for all of the multiaddresses associated with a
1820
// Peer ID

errors.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ package iface
33
import "errors"
44

55
var (
6-
ErrIsDir = errors.New("this dag node is a directory")
7-
ErrNotFile = errors.New("this dag node is not a regular file")
8-
ErrOffline = errors.New("this action must be run in online mode, try running 'ipfs daemon' first")
6+
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrIsDir
7+
ErrIsDir = errors.New("this dag node is a directory")
8+
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrNotFile
9+
ErrNotFile = errors.New("this dag node is not a regular file")
10+
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrOffline
11+
ErrOffline = errors.New("this action must be run in online mode, try running 'ipfs daemon' first")
12+
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrNotSupported
913
ErrNotSupported = errors.New("operation not supported")
1014
)

idfmt.go

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
mbase "github.com/multiformats/go-multibase"
66
)
77

8+
// Deprecated: use github.com/ipfs/boxo/coreiface.FormatKeyID
89
func FormatKeyID(id peer.ID) string {
910
if s, err := peer.ToCid(id).StringOfBase(mbase.Base36); err != nil {
1011
panic(err)
@@ -14,6 +15,8 @@ func FormatKeyID(id peer.ID) string {
1415
}
1516

1617
// FormatKey formats the given IPNS key in a canonical way.
18+
//
19+
// Deprecated: use github.com/ipfs/boxo/coreiface.FormatKey
1720
func FormatKey(key Key) string {
1821
return FormatKeyID(key.ID())
1922
}

key.go

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
)
1212

1313
// Key specifies the interface to Keys in KeyAPI Keystore
14+
//
15+
// Deprecated: use github.com/ipfs/boxo/coreiface.Key
1416
type Key interface {
1517
// Key returns key name
1618
Name() string
@@ -23,6 +25,8 @@ type Key interface {
2325
}
2426

2527
// KeyAPI specifies the interface to Keystore
28+
//
29+
// Deprecated: use github.com/ipfs/boxo/coreiface.KeyAPI
2630
type KeyAPI interface {
2731
// Generate generates new key, stores it in the keystore under the specified
2832
// name and returns a base58 encoded multihash of it's public key

name.go

+6
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ import (
99
"github.com/ipfs/interface-go-ipfs-core/options"
1010
)
1111

12+
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrResolveFailed
1213
var ErrResolveFailed = errors.New("could not resolve name")
1314

1415
// IpnsEntry specifies the interface to IpnsEntries
16+
//
17+
// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsEntry
1518
type IpnsEntry interface {
1619
// Name returns IpnsEntry name
1720
Name() string
1821
// Value returns IpnsEntry value
1922
Value() path.Path
2023
}
2124

25+
// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsResult
2226
type IpnsResult struct {
2327
path.Path
2428
Err error
@@ -32,6 +36,8 @@ type IpnsResult struct {
3236
// its public key.
3337
//
3438
// You can use .Key API to list and generate more names and their respective keys.
39+
//
40+
// Deprecated: use github.com/ipfs/boxo/coreiface.NameAPI
3541
type NameAPI interface {
3642
// Publish announces new IPNS name
3743
Publish(ctx context.Context, path path.Path, opts ...options.NamePublishOption) (IpnsEntry, error)

object.go

+14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
)
1414

1515
// ObjectStat provides information about dag nodes
16+
//
17+
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectStat
1618
type ObjectStat struct {
1719
// Cid is the CID of the node
1820
Cid cid.Cid
@@ -34,20 +36,30 @@ type ObjectStat struct {
3436
}
3537

3638
// ChangeType denotes type of change in ObjectChange
39+
//
40+
// Deprecated: use github.com/ipfs/boxo/coreiface.ChangeType
3741
type ChangeType int
3842

3943
const (
4044
// DiffAdd is set when a link was added to the graph
45+
//
46+
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffAdd
4147
DiffAdd ChangeType = iota
4248

4349
// DiffRemove is set when a link was removed from the graph
50+
//
51+
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffRemove
4452
DiffRemove
4553

4654
// DiffMod is set when a link was changed in the graph
55+
//
56+
// Deprecated: use github.com/ipfs/boxo/coreiface.DiffMod
4757
DiffMod
4858
)
4959

5060
// ObjectChange represents a change ia a graph
61+
//
62+
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectChange
5163
type ObjectChange struct {
5264
// Type of the change, either:
5365
// * DiffAdd - Added a link
@@ -69,6 +81,8 @@ type ObjectChange struct {
6981

7082
// ObjectAPI specifies the interface to MerkleDAG and contains useful utilities
7183
// for manipulating MerkleDAG data structures.
84+
//
85+
// Deprecated: use github.com/ipfs/boxo/coreiface.ObjectAPI
7286
type ObjectAPI interface {
7387
// New creates new, empty (by default) dag-node.
7488
New(context.Context, ...options.ObjectNewOption) (ipld.Node, error)

options/block.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@ import (
88
mh "github.com/multiformats/go-multihash"
99
)
1010

11+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutSettings
1112
type BlockPutSettings struct {
1213
CidPrefix cid.Prefix
1314
Pin bool
1415
}
1516

17+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmSettings
1618
type BlockRmSettings struct {
1719
Force bool
1820
}
1921

22+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutOption
2023
type BlockPutOption func(*BlockPutSettings) error
24+
25+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmOption
2126
type BlockRmOption func(*BlockRmSettings) error
2227

28+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockPutOptions
2329
func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
2430
var cidPrefix cid.Prefix
2531

@@ -45,6 +51,7 @@ func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
4551
return options, nil
4652
}
4753

54+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.BlockRmOptions
4855
func BlockRmOptions(opts ...BlockRmOption) (*BlockRmSettings, error) {
4956
options := &BlockRmSettings{
5057
Force: false,
@@ -61,6 +68,7 @@ func BlockRmOptions(opts ...BlockRmOption) (*BlockRmSettings, error) {
6168

6269
type blockOpts struct{}
6370

71+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Block
6472
var Block blockOpts
6573

6674
// CidCodec is the modern option for Block.Put which specifies the multicodec to use

options/dht.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
package options
22

3+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideSettings
34
type DhtProvideSettings struct {
45
Recursive bool
56
}
67

8+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersSettings
79
type DhtFindProvidersSettings struct {
810
NumProviders int
911
}
1012

13+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideOption
1114
type DhtProvideOption func(*DhtProvideSettings) error
15+
16+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersOption
1217
type DhtFindProvidersOption func(*DhtFindProvidersSettings) error
1318

19+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtProvideOptions
1420
func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
1521
options := &DhtProvideSettings{
1622
Recursive: false,
@@ -25,6 +31,7 @@ func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
2531
return options, nil
2632
}
2733

34+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DhtFindProvidersOptions
2835
func DhtFindProvidersOptions(opts ...DhtFindProvidersOption) (*DhtFindProvidersSettings, error) {
2936
options := &DhtFindProvidersSettings{
3037
NumProviders: 20,
@@ -41,6 +48,7 @@ func DhtFindProvidersOptions(opts ...DhtFindProvidersOption) (*DhtFindProvidersS
4148

4249
type dhtOpts struct{}
4350

51+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Dht
4452
var Dht dhtOpts
4553

4654
// Recursive is an option for Dht.Provide which specifies whether to provide

options/global.go

+5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package options
22

3+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiSettings
34
type ApiSettings struct {
45
Offline bool
56
FetchBlocks bool
67
}
78

9+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOption
810
type ApiOption func(*ApiSettings) error
911

12+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOptions
1013
func ApiOptions(opts ...ApiOption) (*ApiSettings, error) {
1114
options := &ApiSettings{
1215
Offline: false,
@@ -16,6 +19,7 @@ func ApiOptions(opts ...ApiOption) (*ApiSettings, error) {
1619
return ApiOptionsTo(options, opts...)
1720
}
1821

22+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.ApiOptionsTo
1923
func ApiOptionsTo(options *ApiSettings, opts ...ApiOption) (*ApiSettings, error) {
2024
for _, opt := range opts {
2125
err := opt(options)
@@ -28,6 +32,7 @@ func ApiOptionsTo(options *ApiSettings, opts ...ApiOption) (*ApiSettings, error)
2832

2933
type apiOpts struct{}
3034

35+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Api
3136
var Api apiOpts
3237

3338
func (apiOpts) Offline(offline bool) ApiOption {

options/key.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
package options
22

33
const (
4-
RSAKey = "rsa"
4+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.RSAKey
5+
RSAKey = "rsa"
6+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Ed25519Key
57
Ed25519Key = "ed25519"
68

9+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DefaultRSALen
710
DefaultRSALen = 2048
811
)
912

13+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateSettings
1014
type KeyGenerateSettings struct {
1115
Algorithm string
1216
Size int
1317
}
1418

19+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameSettings
1520
type KeyRenameSettings struct {
1621
Force bool
1722
}
1823

24+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateOption
1925
type KeyGenerateOption func(*KeyGenerateSettings) error
26+
27+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameOption
2028
type KeyRenameOption func(*KeyRenameSettings) error
2129

30+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyGenerateOptions
2231
func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error) {
2332
options := &KeyGenerateSettings{
2433
Algorithm: RSAKey,
@@ -34,6 +43,7 @@ func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error)
3443
return options, nil
3544
}
3645

46+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.KeyRenameOptions
3747
func KeyRenameOptions(opts ...KeyRenameOption) (*KeyRenameSettings, error) {
3848
options := &KeyRenameSettings{
3949
Force: false,
@@ -50,6 +60,7 @@ func KeyRenameOptions(opts ...KeyRenameOption) (*KeyRenameSettings, error) {
5060

5161
type keyOpts struct{}
5262

63+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Key
5364
var Key keyOpts
5465

5566
// Type is an option for Key.Generate which specifies which algorithm

options/name.go

+9
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import (
77
)
88

99
const (
10+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.DefaultNameValidTime
1011
DefaultNameValidTime = 24 * time.Hour
1112
)
1213

14+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NamePublishSettings
1315
type NamePublishSettings struct {
1416
ValidTime time.Duration
1517
Key string
@@ -19,15 +21,20 @@ type NamePublishSettings struct {
1921
AllowOffline bool
2022
}
2123

24+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveSettings
2225
type NameResolveSettings struct {
2326
Cache bool
2427

2528
ResolveOpts []ropts.ResolveOpt
2629
}
2730

31+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NamePublishOption
2832
type NamePublishOption func(*NamePublishSettings) error
33+
34+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveOption
2935
type NameResolveOption func(*NameResolveSettings) error
3036

37+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NamePublishOptions
3138
func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) {
3239
options := &NamePublishSettings{
3340
ValidTime: DefaultNameValidTime,
@@ -46,6 +53,7 @@ func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error)
4653
return options, nil
4754
}
4855

56+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.NameResolveOptions
4957
func NameResolveOptions(opts ...NameResolveOption) (*NameResolveSettings, error) {
5058
options := &NameResolveSettings{
5159
Cache: true,
@@ -63,6 +71,7 @@ func NameResolveOptions(opts ...NameResolveOption) (*NameResolveSettings, error)
6371

6472
type nameOpts struct{}
6573

74+
// Deprecated: use github.com/ipfs/boxo/coreiface/options.Name
6675
var Name nameOpts
6776

6877
// ValidTime is an option for Name.Publish which specifies for how long the

0 commit comments

Comments
 (0)