coreapi: don't alias ipld types
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@ab9053378b45e67758591727b9140366d4874fc9 This commit was moved from ipfs/boxo@222c7a617e1ee17ba106b5e5279c15931138abc9
Łukasz Magiera committed
Mar 10, 2018 at 18:31 UTC
3f4a3d552477f2c4387e67f79ff30991a2121525
1 file changed
+6
-11
core/coreiface/interface.go
+6
-11
@@ -30,11 +30,6 @@ type Path interface {
30
Resolved() bool
31
}
32
33
-// TODO: should we really copy these?
34
-// if we didn't, godoc would generate nice links straight to go-ipld-format
35
-type Node ipld.Node
36
-type Link ipld.Link
37
-
33
type Reader interface {
34
io.ReadSeeker
35
io.Closer
@@ -114,7 +109,7 @@ type CoreAPI interface {
109
110
// ResolveNode resolves the path (if not resolved already) using Unixfs
111
// resolver, gets and returns the resolved Node
117
- ResolveNode(context.Context, Path) (Node, error)
112
+ ResolveNode(context.Context, Path) (ipld.Node, error)
113
}
114
115
// UnixfsAPI is the basic interface to immutable files in IPFS
@@ -126,7 +121,7 @@ type UnixfsAPI interface {
121
Cat(context.Context, Path) (Reader, error)
122
123
// Ls returns the list of links in a directory
129
- Ls(context.Context, Path) ([]*Link, error)
124
+ Ls(context.Context, Path) ([]*ipld.Link, error)
125
}
126
127
// BlockAPI specifies the interface to the block layer
@@ -183,7 +178,7 @@ type DagAPI interface {
178
WithHash(mhType uint64, mhLen int) options.DagPutOption
179
180
// Get attempts to resolve and get the node specified by the path
186
- Get(ctx context.Context, path Path) (Node, error)
181
+ Get(ctx context.Context, path Path) (ipld.Node, error)
182
183
// Tree returns list of paths within a node specified by the path.
184
Tree(ctx context.Context, path Path, opts ...options.DagTreeOption) ([]Path, error)
@@ -272,7 +267,7 @@ type KeyAPI interface {
267
// for manipulating MerkleDAG data structures.
268
type ObjectAPI interface {
269
// New creates new, empty (by default) dag-node.
275
- New(context.Context, ...options.ObjectNewOption) (Node, error)
270
+ New(context.Context, ...options.ObjectNewOption) (ipld.Node, error)
271
272
// WithType is an option for New which allows to change the type of created
273
// dag node.
@@ -302,13 +297,13 @@ type ObjectAPI interface {
297
WithDataType(t string) options.ObjectPutOption
298
299
// Get returns the node for the path
305
- Get(context.Context, Path) (Node, error)
300
+ Get(context.Context, Path) (ipld.Node, error)
301
302
// Data returns reader for data of the node
303
Data(context.Context, Path) (io.Reader, error)
304
305
// Links returns lint or links the node contains
311
- Links(context.Context, Path) ([]*Link, error)
306
+ Links(context.Context, Path) ([]*ipld.Link, error)
307
308
// Stat returns information about the node
309
Stat(context.Context, Path) (*ObjectStat, error)