graph

package
v0.0.0-...-e4b21f5 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function struct {
	Name      string `json:"name"`
	LineCount int    `json:"line_count"`
}
type Link struct {
	From      *Node `json:"from"`
	To        *Node `json:"to"`
	IsVisible bool  `json:"is_visible"`
}
func NewLink(from *Node, to *Node, isVisible bool) *Link

func (*Link) ToJSON

func (l *Link) ToJSON() string

type Node

type Node struct {
	PackageName string     `json:"package_name"`
	Path        string     `json:"path"`
	Parent      string     `json:"parent"`
	Type        Type       `json:"type"`
	ImportRaw   []string   `json:"-"`
	LineCount   int        `json:"line_count"`
	Instability *float64   `json:"instability"`
	Functions   []Function `json:"functions"`
}

func NewNode

func NewNode(packageName string, path string, _type Type, importRaw []string) *Node

func (*Node) FileName

func (n *Node) FileName() string

func (*Node) ToJSON

func (n *Node) ToJSON() string

type Tree

type Tree struct {
	Root  *Node            `json:"root"`
	Nodes map[string]*Node `json:"nodes"`
	Links []*Link          `json:"links"`
}

func NewTree

func NewTree(moduleName string) *Tree

func (*Tree) CalculateInstability

func (t *Tree) CalculateInstability()
func (t *Tree) GenerateLinks()

func (*Tree) ToJSON

func (t *Tree) ToJSON() string

type Type

type Type uint
const (
	Dir Type = 1 << iota
	File
)

Jump to

Keyboard shortcuts

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