view

package
v0.0.0-...-53c6946 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNCHANGED = iota // 不变
	INSERTED         // 新增
	REMOVED          // 删除
	CHANGED          // 变化
	AFFECTED         // 传播中受到了影响
)

Variables

This section is empty.

Functions

func GenerateLegend

func GenerateLegend(graph *gographviz.Graph, lineColorMap map[DiffType]string, fillColorMap map[DiffType]string, lineStyleMap map[DiffType]string)

func OutputJSON

func OutputJSON(g *DiffGraph, doPrintPrivate bool, doPrintUnchanged bool, pkg string) error

Types

type DiffEdge

type DiffEdge struct {
	Node       *DiffNode //连接的点
	Difference DiffType
}

func NewDiffEdgeHelper

func NewDiffEdgeHelper(n *DiffNode) *DiffEdge

type DiffGraph

type DiffGraph struct {
	Nodes map[string]*DiffNode
}

func NewDiffGraphHelper

func NewDiffGraphHelper() *DiffGraph

NewDiffGraphHelper 方便申请节点

func (*DiffGraph) CalcAffected

func (g *DiffGraph) CalcAffected()

func (*DiffGraph) DebugDiffGraph

func (g *DiffGraph) DebugDiffGraph()

func (*DiffGraph) OutputDiffGraph

func (g *DiffGraph) OutputDiffGraph(o *common.DiffOptions)

func (*DiffGraph) Visualization

func (g *DiffGraph) Visualization(doPrintPrivate bool, doPrintUnchanged bool, pkg string) error

type DiffNode

type DiffNode struct {
	Name       string               //函数名称
	Difference DiffType             //0本身代码无变化,1新增,2删除,3本身的代码改变
	CallEdge   map[string]*DiffEdge //调用的函数,map[调用的函数名称]
}

func NewDiffNodeHelper

func NewDiffNodeHelper() *DiffNode

func (*DiffNode) GetFuncName

func (n *DiffNode) GetFuncName() string

func (*DiffNode) GetPath

func (n *DiffNode) GetPath() string

func (*DiffNode) GetPkgName

func (n *DiffNode) GetPkgName() string

func (*DiffNode) GetPrettyName

func (n *DiffNode) GetPrettyName() string

func (*DiffNode) IsPrivate

func (n *DiffNode) IsPrivate() bool

type DiffType

type DiffType int

type Output

type Output struct {
	Pkg        string     `json:"pkg"`
	ChangeList changeList `json:"change_list"`
}

Jump to

Keyboard shortcuts

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