@cryptotaxi247 / kubo / commits / 4124018bc

interface docs for coreapi interface

License: MIT Signed-off-by: ForrestWeston <forrest@protocol.ai> This commit was moved from ipfs/interface-go-ipfs-core@2c3137f0557f44ca23730ff134b38b9426731e56 This commit was moved from ipfs/boxo@4d4c3dc176859461010b576f9af66919f34aaed3

ForrestWeston committed Jan 22, 2018 at 14:44 UTC 4124018bc2dbec4efc870ce6046e941bc8987fc3
1 file changed +14 -1
core/coreiface/interface.go
+14 -1
@@ -17,9 +17,13 @@ import (
17 // Path is a generic wrapper for paths used in the API. A path can be resolved
18 // to a CID using one of Resolve functions in the API.
19 type Path interface {
20 + // String returns the path as a string.
21 String() string
22 + // Cid returns cid referred to by path
23 Cid() *cid.Cid
24 + // Root returns cid of root path
25 Root() *cid.Cid
26 + // Resolved returns whether path has been fully resolved
27 Resolved() bool
28 }
29
@@ -33,22 +37,31 @@ type Reader interface {
37 io.Closer
38 }
39
40 +// IpnsEntry specifies the interface to IpnsEntries
41 type IpnsEntry interface {
42 + // Name returns IpnsEntry name
43 Name() string
44 + // Value returns IpnsEntry value
45 Value() Path
46 }
47
48 +// Key specifies the interface to Keys in KeyAPI Keystore
49 type Key interface {
50 + // Key returns key name
51 Name() string
52 + // Path returns key path
53 Path() Path
54 }
55
56 // CoreAPI defines an unified interface to IPFS for Go programs.
57 type CoreAPI interface {
48 - // Unixfs returns an implementation of Unixfs API
58 + // Unixfs returns an implementation of Unixfs API.
59 Unixfs() UnixfsAPI
60 + // Dag returns an implementation of Dag API.
61 Dag() DagAPI
62 + // Name returns an implementation of Name API.
63 Name() NameAPI
64 + // Key returns an implementation of Key API.
65 Key() KeyAPI
66
67 // ResolvePath resolves the path using Unixfs resolver