dagutils

package
v0.4.13-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Add = iota
	Remove
	Mod
)

Variables

This section is empty.

Functions

func ApplyChange added in v0.3.8

func ApplyChange(ctx context.Context, ds dag.DAGService, nd *dag.ProtoNode, cs []*Change) (*dag.ProtoNode, error)

func DiffEnumerate added in v0.4.10

func DiffEnumerate(ctx context.Context, dserv node.NodeGetter, from, to *cid.Cid) error

DiffEnumerate fetches every object in the graph pointed to by 'to' that is not in 'from'. This can be used to more efficiently fetch a graph if you can guarantee you already have the entirety of 'from'

func MergeDiffs added in v0.3.8

func MergeDiffs(a, b []*Change) ([]*Change, []Conflict)

func NewMemoryDagService added in v0.4.0

func NewMemoryDagService() dag.DAGService

Types

type Change added in v0.3.8

type Change struct {
	Type   int
	Path   string
	Before *cid.Cid
	After  *cid.Cid
}

func Diff added in v0.3.8

func Diff(ctx context.Context, ds dag.DAGService, a, b node.Node) ([]*Change, error)

Diff returns a set of changes that transform node 'a' into node 'b'

func (*Change) String added in v0.3.8

func (c *Change) String() string

type Conflict added in v0.3.8

type Conflict struct {
	A *Change
	B *Change
}

type Editor

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

func NewDagEditor

func NewDagEditor(root *dag.ProtoNode, source dag.DAGService) *Editor

root is the node to be modified, source is the dagstore to pull nodes from (optional)

func (*Editor) Finalize added in v0.4.0

func (e *Editor) Finalize(ds dag.DAGService) (*dag.ProtoNode, error)

func (*Editor) GetDagService added in v0.3.8

func (e *Editor) GetDagService() dag.DAGService

func (*Editor) GetNode

func (e *Editor) GetNode() *dag.ProtoNode

func (*Editor) InsertNodeAtPath

func (e *Editor) InsertNodeAtPath(ctx context.Context, pth string, toinsert node.Node, create func() *dag.ProtoNode) error
func (e *Editor) RmLink(ctx context.Context, pth string) error

Jump to

Keyboard shortcuts

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