mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 19:44:01 +08:00
48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
// Package iface defines IPFS Core API which is a set of interfaces used to
|
|
// interact with IPFS nodes.
|
|
package iface
|
|
|
|
import (
|
|
"context"
|
|
|
|
ipld "gx/ipfs/QmZtNq8dArGfnpCZfx2pUNY7UcjGhVp5qqwQ4hH6mpTMRQ/go-ipld-format"
|
|
cid "gx/ipfs/QmapdYm1b22Frv3k17fqrBYTFRxwiaVJkB299Mfn33edeB/go-cid"
|
|
)
|
|
|
|
// CoreAPI defines an unified interface to IPFS for Go programs
|
|
type CoreAPI interface {
|
|
// Unixfs returns an implementation of Unixfs API
|
|
Unixfs() UnixfsAPI
|
|
|
|
// Block returns an implementation of Block API
|
|
Block() BlockAPI
|
|
|
|
// Dag returns an implementation of Dag API
|
|
Dag() DagAPI
|
|
|
|
// Name returns an implementation of Name API
|
|
Name() NameAPI
|
|
|
|
// Key returns an implementation of Key API
|
|
Key() KeyAPI
|
|
|
|
// Pin returns an implementation of Pin API
|
|
Pin() PinAPI
|
|
|
|
// ObjectAPI returns an implementation of Object API
|
|
Object() ObjectAPI
|
|
|
|
// ResolvePath resolves the path using Unixfs resolver
|
|
ResolvePath(context.Context, Path) (ResolvedPath, error)
|
|
|
|
// ResolveNode resolves the path (if not resolved already) using Unixfs
|
|
// resolver, gets and returns the resolved Node
|
|
ResolveNode(context.Context, Path) (ipld.Node, error)
|
|
|
|
// ParsePath parses string path to a Path
|
|
ParsePath(context.Context, string) (Path, error)
|
|
|
|
// ParseCid creates new path from the provided CID
|
|
ParseCid(*cid.Cid) ResolvedPath
|
|
}
|