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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 7 additions & 3 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 8 additions & 0 deletions
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

0 commit comments

Comments
 (0)