Package mod provides DAG modification utilities to, for example, insert additional nodes in a unixfs DAG or truncate them.
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(ctx context.Context, from ipld.Node, serv ipld.DAGService, spl chunker.SplitterGen) (*DagModifier, error)
NewDagModifier returns a new DagModifier, the Cid prefix for newly created nodes will be inhered from the passed in node. If the Cid version if not 0 raw leaves will also be enabled. The Prefix and RawLeaves options can be overridden by changing them after the call.
CtxReadFull reads data from this dag starting at the current offset
GetNode gets the modified DAG Node
HasChanges returned whether or not there are unflushed changes to this dag
Read data from this dag starting at the current offset
Seek modifies the offset according to whence. See unixfs/io for valid whence values.
Size returns the Filesize of the node
Sync writes changes to this dag to disk
Truncate truncates the current Node to 'size' and replaces it with the new one.
Write continues writing to the dag at the current offset
WriteAt will modify a dag file in place