Documentation ¶
Overview ¶
package unixfs/io implements convenience objects for working with the ipfs unixfs data format.
Index ¶
- Variables
- func NewDirectory(dserv mdag.DAGService) *directoryBuilder
- func NewEmptyDirectory() *mdag.Node
- type DagReader
- func (dr *DagReader) Close() error
- func (dr *DagReader) CtxReadFull(ctx context.Context, b []byte) (int, error)
- func (dr *DagReader) Read(b []byte) (int, error)
- func (dr *DagReader) Seek(offset int64, whence int) (int64, error)
- func (dr *DagReader) Size() uint64
- func (dr *DagReader) WriteTo(w io.Writer) (int64, error)
- type ReadSeekCloser
Constants ¶
This section is empty.
Variables ¶
var ErrCantReadSymlinks = errors.New("cannot currently read symlinks")
var ErrIsDir = errors.New("this dag node is a directory")
Functions ¶
func NewDirectory ¶
func NewDirectory(dserv mdag.DAGService) *directoryBuilder
NewDirectory returns a directoryBuilder. It needs a DAGService to add the Children
func NewEmptyDirectory ¶ added in v0.3.4
NewEmptyDirectory returns an empty merkledag Node with a folder Data chunk
Types ¶
type DagReader ¶
type DagReader struct {
// contains filtered or unexported fields
}
DagReader provides a way to easily read the data contained in a dag.
func NewDagReader ¶
NewDagReader creates a new reader object that reads the data represented by the given node, using the passed in DAGService for data retreival
func NewDataFileReader ¶ added in v0.3.8
func (*DagReader) CtxReadFull ¶ added in v0.3.2
CtxReadFull reads data from the DAG structured file
func (*DagReader) Seek ¶
Seek implements io.Seeker, and will seek to a given offset in the file interface matches standard unix seek TODO: check if we can do relative seeks, to reduce the amount of dagreader recreations that need to happen.
type ReadSeekCloser ¶
func NewRSNCFromBytes ¶
func NewRSNCFromBytes(b []byte) ReadSeekCloser