graph

package
v0.7.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MPL-2.0 Imports: 5 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkipLine = errors.New("ReadTree: skip line")
	Root        = struct{}{}
)

Functions

func Flatten

func Flatten(pkgMap interface{}, root Tree, flatten FlattenFunc)

func Unwrap

func Unwrap(imports interface{}, graph interface{}, result Rooted) error

See https://jimmyfrasche.github.io/go-reflection-codex/

Types

type Deps

type Deps map[pkg.ID]pkg.Package

type FlattenFunc

type FlattenFunc func(node interface{}) (key interface{}, value interface{})

type Graph

type Graph map[interface{}][]interface{}

type LineParser

type LineParser func(line string) (level int, node interface{}, err error)

type Rooted

type Rooted struct {
	Imports []interface{}
	Graph   Graph
}

func ReadTree

func ReadTree(lines string, parser LineParser) (Rooted, error)

type Tree

type Tree interface {
	Children() []Tree
}

Jump to

Keyboard shortcuts

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