file

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TagEntry = "entry"
View Source
const TagRed = "red"

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph added in v0.10.0

type Graph struct {
	// reference graph (called graph)
	G graph.Graph[string, *Vertex]
	// reverse reference graph (call graph)
	Rg graph.Graph[string, *Vertex]
	// k: id, v: file
	IdCache map[string]*Vertex
}

func CreateFileGraph added in v0.10.0

func CreateFileGraph(relationship *object.SourceContext, opts *common.GraphOptions) (*Graph, error)

func CreateFileGraphFromDirWithLSIF added in v0.10.0

func CreateFileGraphFromDirWithLSIF(opts *common.GraphOptions) (*Graph, error)

func CreateFileGraphFromDirWithSCIP added in v0.10.0

func CreateFileGraphFromDirWithSCIP(opts *common.GraphOptions) (*Graph, error)

func CreateFileGraphFromGolangDir added in v0.10.0

func CreateFileGraphFromGolangDir(opts *common.GraphOptions) (*Graph, error)

func NewEmptyFileGraph added in v0.10.0

func NewEmptyFileGraph() *Graph

func (*Graph) DirectReferenceIds added in v0.10.0

func (fg *Graph) DirectReferenceIds(f *Vertex) []string

func (*Graph) DirectReferencedCount added in v0.10.0

func (fg *Graph) DirectReferencedCount(f *Vertex) int

func (*Graph) DirectReferencedIds added in v0.10.0

func (fg *Graph) DirectReferencedIds(f *Vertex) []string

func (*Graph) DrawDot added in v0.10.0

func (fg *Graph) DrawDot(filename string) error

func (*Graph) DrawG6Html added in v0.10.0

func (fg *Graph) DrawG6Html(filename string) error

func (*Graph) EntryIds added in v0.10.0

func (fg *Graph) EntryIds(f *Vertex) []string

func (*Graph) FillWithRed added in v0.10.0

func (fg *Graph) FillWithRed(vertexHash string) error

func (*Graph) FilterFunctions added in v0.10.0

func (fg *Graph) FilterFunctions(f func(*Vertex) bool) []*Vertex

func (*Graph) GetById added in v0.10.0

func (fg *Graph) GetById(id string) *Vertex

func (*Graph) GlobalStat added in v0.10.2

func (fg *Graph) GlobalStat(points []*Vertex) *object.StatGlobal

func (*Graph) ListEntries added in v0.10.0

func (fg *Graph) ListEntries() []*Vertex

func (*Graph) ListFiles added in v0.10.0

func (fg *Graph) ListFiles() []*Vertex

func (*Graph) RelationBetween added in v0.10.1

func (fg *Graph) RelationBetween(a string, b string) (*common.EdgeStorage, error)

func (*Graph) RemoveNodeById added in v0.10.0

func (fg *Graph) RemoveNodeById(path string) error

func (*Graph) Stat added in v0.10.0

func (fg *Graph) Stat(f *Vertex) *object.ImpactUnit

func (*Graph) ToDirGraph added in v0.10.0

func (fg *Graph) ToDirGraph() (*Graph, error)

func (*Graph) ToG6Data added in v0.10.0

func (fg *Graph) ToG6Data() (*g6.Data, error)

func (*Graph) TransitiveReferenceIds added in v0.10.0

func (fg *Graph) TransitiveReferenceIds(f *Vertex) []string

func (*Graph) TransitiveReferencedIds added in v0.10.0

func (fg *Graph) TransitiveReferencedIds(f *Vertex) []string

type Vertex added in v0.10.0

type Vertex struct {
	Path       string
	Referenced int

	// https://github.com/williamfzc/srctx/issues/41
	Tags map[string]struct{} `json:"tags,omitempty"`
}

func Path2vertex

func Path2vertex(fp string) *Vertex

func (*Vertex) AddTag added in v0.10.0

func (fv *Vertex) AddTag(tag string)

func (*Vertex) ContainTag added in v0.10.0

func (fv *Vertex) ContainTag(tag string) bool

func (*Vertex) Id added in v0.10.0

func (fv *Vertex) Id() string

func (*Vertex) RemoveTag added in v0.10.0

func (fv *Vertex) RemoveTag(tag string)

Jump to

Keyboard shortcuts

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