unixfs.go 512 Bytes
Newer Older
1 2 3 4 5 6
package iface

import (
	"context"
	"io"

Steven Allen's avatar
Steven Allen committed
7
	ipld "gx/ipfs/QmaA8GkXUYinkkndvg7T6Tx7gYXemhxjaxLisEPes7Rf1P/go-ipld-format"
8 9 10 11 12
)

// UnixfsAPI is the basic interface to immutable files in IPFS
type UnixfsAPI interface {
	// Add imports the data from the reader into merkledag file
13
	Add(context.Context, io.Reader) (ResolvedPath, error)
14 15 16 17 18 19 20

	// Cat returns a reader for the file
	Cat(context.Context, Path) (Reader, error)

	// Ls returns the list of links in a directory
	Ls(context.Context, Path) ([]*ipld.Link, error)
}