mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
* go-log * sys * go-crypto License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
25 lines
780 B
Go
25 lines
780 B
Go
package iface
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
options "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
|
|
|
|
ipld "gx/ipfs/QmWi2BYBL5gJ3CiAiQchg6rn1A8iBsrWy51EYxvHVjFvLb/go-ipld-format"
|
|
)
|
|
|
|
// DagAPI specifies the interface to IPLD
|
|
type DagAPI interface {
|
|
// Put inserts data using specified format and input encoding.
|
|
// Unless used with WithCodec or WithHash, the defaults "dag-cbor" and
|
|
// "sha256" are used.
|
|
Put(ctx context.Context, src io.Reader, opts ...options.DagPutOption) (Path, error)
|
|
|
|
// Get attempts to resolve and get the node specified by the path
|
|
Get(ctx context.Context, path Path) (ipld.Node, error)
|
|
|
|
// Tree returns list of paths within a node specified by the path.
|
|
Tree(ctx context.Context, path Path, opts ...options.DagTreeOption) ([]Path, error)
|
|
}
|