mod

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSeekEndNotImpl = errors.New("SEEK_END currently not implemented")
View Source
var ErrSeekFail = errors.New("failed to seek properly")
View Source
var ErrUnrecognizedWhence = errors.New("unrecognized whence")

Functions

This section is empty.

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(ctx context.Context, from *mdag.Node, serv mdag.DAGService, mp pin.ManualPinner, spl chunk.BlockSplitter) (*DagModifier, error)

func (*DagModifier) CtxReadFull

func (dm *DagModifier) CtxReadFull(ctx context.Context, b []byte) (int, error)

Read data from this dag starting at the current offset

func (*DagModifier) GetNode

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

GetNode gets the modified DAG Node

func (*DagModifier) HasChanges

func (dm *DagModifier) HasChanges() bool

HasChanges returned whether or not there are unflushed changes to this dag

func (*DagModifier) Read

func (dm *DagModifier) Read(b []byte) (int, error)

Read data from this dag starting at the current offset

func (*DagModifier) Seek

func (dm *DagModifier) Seek(offset int64, whence int) (int64, error)

func (*DagModifier) Size

func (dm *DagModifier) Size() (int64, error)

func (*DagModifier) Sync

func (dm *DagModifier) Sync() error

Sync writes changes to this dag to disk

func (*DagModifier) Truncate

func (dm *DagModifier) Truncate(size int64) error

func (*DagModifier) Write

func (dm *DagModifier) Write(b []byte) (int, error)

Write continues writing to the dag at the current offset

func (*DagModifier) WriteAt

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

WriteAt will modify a dag file in place

Jump to

Keyboard shortcuts

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