tree

package
v0.0.0-...-a3c17cd Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDepth = 100

MaxDepth for tree traversal

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildCtx

type BuildCtx interface {
	Import(path string, srcDir string, mode build.ImportMode) (*build.Package, error)
}

type JsonNode

type JsonNode struct {
	Data JsonNodeData `json:"data,omitempty"`
}

type JsonNodeData

type JsonNodeData struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Type   string `json:"type,omitempty"`
	Source string `json:"source,omitempty"`
	Target string `json:"target,omitempty"`
}

type PackageNode

type PackageNode struct {
	ID      string
	Name    string
	Type    mod.ImportType
	Imports []*PackageNode
}

func (*PackageNode) MarshalJSON

func (node *PackageNode) MarshalJSON() (res []byte, err error)

func (*PackageNode) Traverse

func (node *PackageNode) Traverse(cb func(node *PackageNode))

type TreeBuilder

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

func NewTreeBuilder

func NewTreeBuilder(ctx BuildCtx, modInfo mod.ModInfos) *TreeBuilder

func (*TreeBuilder) DependencyTree

func (tb *TreeBuilder) DependencyTree(dir, pkgName string) (node *PackageNode, err error)

Jump to

Keyboard shortcuts

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