Documentation
¶
Overview ¶
package unixfs/io implements convenience objects for working with the ipfs unixfs data format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIsDir = errors.New("this dag node is a directory")
Functions ¶
func NewDirectory ¶
func NewDirectory(dserv mdag.DAGService) *directoryBuilder
Types ¶
type DagModifier ¶
type DagModifier struct {
// contains filtered or unexported fields
}
DagModifier is the only struct licensed and able to correctly perform surgery on a DAG 'file' Dear god, please rename this to something more pleasant
func NewDagModifier ¶
func NewDagModifier(from *mdag.Node, serv mdag.DAGService, spl chunk.BlockSplitter) (*DagModifier, error)
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 ¶
func NewDagReader(ctx context.Context, n *mdag.Node, serv mdag.DAGService) (*DagReader, error)
NewDagReader creates a new reader object that reads the data represented by the given node, using the passed in DAGService for data retreival
func (*DagReader) Read ¶
func (dr *DagReader) Read(b []byte) (int, error)
Read reads data from the DAG structured file
func (*DagReader) Seek ¶
func (dr *DagReader) Seek(offset int64, whence int) (int64, error)
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 ¶
type ReadSeekCloser interface {
io.Reader
io.Seeker
io.Closer
io.WriterTo
}
func NewRSNCFromBytes ¶
func NewRSNCFromBytes(b []byte) ReadSeekCloser