io

package
v0.0.0-...-e4696f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

package unixfs/io implements convenience objects for working with the ipfs unixfs data format.

Index

Constants

This section is empty.

Variables

View Source
var ErrIsDir = errors.New("this dag node is a directory")

Functions

func NewDagReader

func NewDagReader(n *mdag.Node, serv mdag.DAGService) (io.Reader, error)

NewDagReader creates a new reader object that reads the data represented by the given node, using the passed in DAGService for data retreival

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)

func (*DagModifier) GetNode

func (dm *DagModifier) GetNode() (*mdag.Node, error)

GetNode gets the modified DAG Node

func (*DagModifier) Size

func (dm *DagModifier) Size() uint64

func (*DagModifier) WriteAt

func (dm *DagModifier) WriteAt(b []byte, offset uint64) (int, error)

WriteAt will modify a dag file in place NOTE: it currently assumes only a single level of indirection

type DagReader

type DagReader struct {
	// contains filtered or unexported fields
}

DagReader provides a way to easily read the data contained in a dag.

func (*DagReader) Read

func (dr *DagReader) Read(b []byte) (int, error)

Read reads data from the DAG structured file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL