dagutils

package
v0.0.0-...-795e242 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Add = iota
	Remove
	Mod
)

Variables

This section is empty.

Functions

func ApplyChange

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

func MergeDiffs

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

Types

type Change

type Change struct {
	Type   int
	Path   string
	Before key.Key
	After  key.Key
}

func Diff

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

func (*Change) String

func (c *Change) String() string

type Conflict

type Conflict struct {
	A *Change
	B *Change
}

type Editor

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

func NewDagEditor

func NewDagEditor(ds dag.DAGService, root *dag.Node) *Editor

func (*Editor) GetDagService

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

func (*Editor) GetNode

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

func (*Editor) InsertNodeAtPath

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

func (*Editor) WriteOutputTo

func (e *Editor) WriteOutputTo(ds dag.DAGService) error

Jump to

Keyboard shortcuts

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