file

package
v0.0.0-...-bd4d0b6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 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

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

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

func CreateFileGraphFromDirWithLSIF

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

func CreateFileGraphFromDirWithSCIP

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

func CreateFileGraphFromGolangDir

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

func NewEmptyFileGraph

func NewEmptyFileGraph() *Graph

func (*Graph) DirectReferenceIds

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

func (*Graph) DirectReferencedCount

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

func (*Graph) DirectReferencedIds

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

func (*Graph) DrawDot

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

func (*Graph) DrawG6Html

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

func (*Graph) EntryIds

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

func (*Graph) FillWithRed

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

func (*Graph) FilterFunctions

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

func (*Graph) GetById

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

func (*Graph) GlobalStat

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

func (*Graph) ListEntries

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

func (*Graph) ListFiles

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

func (*Graph) RelationBetween

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

func (*Graph) RemoveNodeById

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

func (*Graph) Stat

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

func (*Graph) ToDirGraph

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

func (*Graph) ToG6Data

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

func (*Graph) TransitiveReferenceIds

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

func (*Graph) TransitiveReferencedIds

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

type Vertex

type Vertex struct {
	Path       string
	Referenced int

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

func Path2vertex

func Path2vertex(fp string) *Vertex

func (*Vertex) AddTag

func (fv *Vertex) AddTag(tag string)

func (*Vertex) ContainTag

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

func (*Vertex) Id

func (fv *Vertex) Id() string

func (*Vertex) RemoveTag

func (fv *Vertex) RemoveTag(tag string)

Jump to

Keyboard shortcuts

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