Documentation
¶
Index ¶
- func NewFileEntDB(conf *conf.Data) (repo.FileRepo, error)
- func ParseDBPath(dbPath string) string
- type FileEntDB
- func (f *FileEntDB) Close() error
- func (f *FileEntDB) DeleteFileInfo(id int64) error
- func (f *FileEntDB) GetFileInfoByID(id int64) (*dos.FileInfo, error)
- func (f *FileEntDB) ListFileInfos(fileType dos.FileType, limit int, offset int) ([]*dos.FileInfo, error)
- func (f *FileEntDB) SaveFileInfo(info *dos.FileInfo) error
- type StaticEntDBImpl
- func (s *StaticEntDBImpl) BatchSaveFuncEdges(edges []*dos.FuncEdge) error
- func (s *StaticEntDBImpl) BatchSaveFuncNodes(nodes []*dos.FuncNode) error
- func (s *StaticEntDBImpl) BatchSavePackageDeps(deps []*dos.PackageDep) error
- func (s *StaticEntDBImpl) BatchSavePackages(pkgs []*dos.Package) error
- func (s *StaticEntDBImpl) Close() error
- func (s *StaticEntDBImpl) GetAllFuncEdges() ([]*dos.FuncEdge, error)
- func (s *StaticEntDBImpl) GetAllFuncNodes() ([]*dos.FuncNode, error)
- func (s *StaticEntDBImpl) GetAllPackageDeps() ([]*dos.PackageDep, error)
- func (s *StaticEntDBImpl) GetAllPackages() ([]*dos.Package, error)
- func (s *StaticEntDBImpl) GetCalleeEdges(callerKey string) ([]*dos.FuncNode, error)
- func (s *StaticEntDBImpl) GetCallerEdges(calleeKey string) ([]*dos.FuncNode, error)
- func (s *StaticEntDBImpl) GetFuncNodeByKey(key string) (*dos.FuncNode, error)
- func (s *StaticEntDBImpl) GetPackageByPath(pkgPath string) (*dos.Package, error)
- func (s *StaticEntDBImpl) GetPackageDeps(importerPkg string) ([]*dos.PackageDep, error)
- func (s *StaticEntDBImpl) GetProjectModulePath() (string, error)
- func (s *StaticEntDBImpl) GetTargetProjectPrefixes() []string
- func (s *StaticEntDBImpl) InitTable() error
- func (s *StaticEntDBImpl) IsInternalPackage(pkgPath string) bool
- func (s *StaticEntDBImpl) ListImportedBy(pkgPath string) ([]*dos.Package, error)
- func (s *StaticEntDBImpl) ListImportersOf(pkgPath string) ([]*dos.Package, error)
- func (s *StaticEntDBImpl) SaveFuncEdge(edge *dos.FuncEdge) error
- func (s *StaticEntDBImpl) SaveFuncNode(node *dos.FuncNode) error
- func (s *StaticEntDBImpl) SavePackage(packageInfo *dos.Package) error
- func (s *StaticEntDBImpl) SavePackageDep(dep *dos.PackageDep) error
- func (s *StaticEntDBImpl) SearchFuncNodes(query string, limit int) ([]*dos.FuncNode, error)
- func (s *StaticEntDBImpl) SearchPackages(query string, limit int) ([]*dos.Package, error)
- type TraceEntDB
- func (d *TraceEntDB) Close() error
- func (d *TraceEntDB) GetActiveGoroutineCount() (int, error)
- func (d *TraceEntDB) GetAllFunctionName() ([]string, error)
- func (d *TraceEntDB) GetAllGIDs(page int, limit int) ([]dos.GoroutineTrace, error)
- func (d *TraceEntDB) GetAllParentFunctions(functionName string) ([]*dos.Function, error)
- func (d *TraceEntDB) GetAllTraceTimeCosts() ([]string, error)
- func (d *TraceEntDB) GetCalleeFunctions(functionName string) ([]string, error)
- func (d *TraceEntDB) GetCallerFunctions(functionName string) ([]string, error)
- func (d *TraceEntDB) GetChildFunctions(parentId int64) ([]*dos.Function, error)
- func (d *TraceEntDB) GetFunctionAnalysis(functionName string, queryType string) ([]dos.FunctionNode, error)
- func (d *TraceEntDB) GetFunctionCallDepths(functionName string) ([]int, error)
- func (d *TraceEntDB) GetFunctionInfoInGoroutine(gid uint64, targetFunctionId int64) (*dos.FunctionInfo, error)
- func (d *TraceEntDB) GetGidsByFunctionName(functionName string) ([]string, error)
- func (d *TraceEntDB) GetGoroutineByGID(gid int64) (*dos.GoroutineTrace, error)
- func (d *TraceEntDB) GetGoroutineCallDepth(gid uint64) (int, error)
- func (d *TraceEntDB) GetGoroutineExecutionTime(gid uint64) (string, error)
- func (d *TraceEntDB) GetHotFunctions(sortBy string) ([]dos.Function, error)
- func (d *TraceEntDB) GetInitialFunc(gid uint64) (string, error)
- func (d *TraceEntDB) GetLastFunction() (*dos.TraceData, error)
- func (d *TraceEntDB) GetMaxCallDepth() (int, error)
- func (d *TraceEntDB) GetParamsByID(id int32) ([]dos.TraceParams, error)
- func (d *TraceEntDB) GetSampledFunctionNames(maxSamples int32) ([]string, error)
- func (d *TraceEntDB) GetTotalGIDs() (int, error)
- func (d *TraceEntDB) GetTraceByID(id int) (*dos.TraceData, error)
- func (d *TraceEntDB) GetTraceChildren(parentID int64) ([]dos.TraceData, error)
- func (d *TraceEntDB) GetTracesByFuncName(functionName string) ([]dos.TraceData, error)
- func (d *TraceEntDB) GetTracesByGID(gid uint64, depth int, createTime string) ([]dos.TraceData, error)
- func (d *TraceEntDB) GetTracesByParentId(parentId int64) ([]dos.TraceData, error)
- func (d *TraceEntDB) IsGoroutineFinished(gid uint64) (bool, error)
- func (d *TraceEntDB) SearchFunctions(ctx context.Context, dbPath string, query string, limit int32) ([]*dos.Function, int32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileEntDB ¶
NewFileEntDB 创建文件数据库管理实例(使用 Ent 框架)
Types ¶
type FileEntDB ¶
type FileEntDB struct {
// contains filtered or unexported fields
}
FileEntDB 使用 Ent 框架的文件数据库管理结构
func (*FileEntDB) DeleteFileInfo ¶
DeleteFileInfo 删除文件信息
func (*FileEntDB) GetFileInfoByID ¶
GetFileInfoByID 根据ID获取文件信息
type StaticEntDBImpl ¶
type StaticEntDBImpl struct {
// contains filtered or unexported fields
}
StaticEntDBImpl 使用 Ent 框架的静态分析数据库实现
func NewStaticEntDBImpl ¶
func NewStaticEntDBImpl(dbPath string) (*StaticEntDBImpl, error)
NewStaticEntDBImpl 创建函数节点数据库(使用 Ent 框架)
func (*StaticEntDBImpl) BatchSaveFuncEdges ¶ added in v1.2.1
func (s *StaticEntDBImpl) BatchSaveFuncEdges(edges []*dos.FuncEdge) error
BatchSaveFuncEdges 批量保存函数调用关系
func (*StaticEntDBImpl) BatchSaveFuncNodes ¶ added in v1.2.1
func (s *StaticEntDBImpl) BatchSaveFuncNodes(nodes []*dos.FuncNode) error
BatchSaveFuncNodes 批量保存函数节点
func (*StaticEntDBImpl) BatchSavePackageDeps ¶ added in v1.2.1
func (s *StaticEntDBImpl) BatchSavePackageDeps(deps []*dos.PackageDep) error
BatchSavePackageDeps 批量保存包依赖关系
func (*StaticEntDBImpl) BatchSavePackages ¶ added in v1.2.1
func (s *StaticEntDBImpl) BatchSavePackages(pkgs []*dos.Package) error
BatchSavePackages 批量保存包信息
func (*StaticEntDBImpl) GetAllFuncEdges ¶
func (s *StaticEntDBImpl) GetAllFuncEdges() ([]*dos.FuncEdge, error)
GetAllFuncEdges 获取所有函数调用边
func (*StaticEntDBImpl) GetAllFuncNodes ¶
func (s *StaticEntDBImpl) GetAllFuncNodes() ([]*dos.FuncNode, error)
GetAllFuncNodes 获取所有函数节点
func (*StaticEntDBImpl) GetAllPackageDeps ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetAllPackageDeps() ([]*dos.PackageDep, error)
GetAllPackageDeps 获取所有包依赖关系
func (*StaticEntDBImpl) GetAllPackages ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetAllPackages() ([]*dos.Package, error)
GetAllPackages 获取所有包
func (*StaticEntDBImpl) GetCalleeEdges ¶
func (s *StaticEntDBImpl) GetCalleeEdges(callerKey string) ([]*dos.FuncNode, error)
GetCalleeEdges 获取该函数调用的所有节点
func (*StaticEntDBImpl) GetCallerEdges ¶
func (s *StaticEntDBImpl) GetCallerEdges(calleeKey string) ([]*dos.FuncNode, error)
GetCallerEdges 获取调用该函数的所有节点
func (*StaticEntDBImpl) GetFuncNodeByKey ¶
func (s *StaticEntDBImpl) GetFuncNodeByKey(key string) (*dos.FuncNode, error)
GetFuncNodeByKey 根据Key获取函数节点
func (*StaticEntDBImpl) GetPackageByPath ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetPackageByPath(pkgPath string) (*dos.Package, error)
GetPackageByPath 根据包路径获取包信息
func (*StaticEntDBImpl) GetPackageDeps ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetPackageDeps(importerPkg string) ([]*dos.PackageDep, error)
GetPackageDeps 获取包依赖关系
func (*StaticEntDBImpl) GetProjectModulePath ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetProjectModulePath() (string, error)
GetProjectModulePath 公开方法用于测试
func (*StaticEntDBImpl) GetTargetProjectPrefixes ¶ added in v1.2.1
func (s *StaticEntDBImpl) GetTargetProjectPrefixes() []string
GetTargetProjectPrefixes 公开方法用于测试
func (*StaticEntDBImpl) IsInternalPackage ¶ added in v1.2.1
func (s *StaticEntDBImpl) IsInternalPackage(pkgPath string) bool
IsInternalPackage 公开方法用于测试
func (*StaticEntDBImpl) ListImportedBy ¶ added in v1.2.1
func (s *StaticEntDBImpl) ListImportedBy(pkgPath string) ([]*dos.Package, error)
ListImportedBy 获取指定包导入的所有包
func (*StaticEntDBImpl) ListImportersOf ¶ added in v1.2.1
func (s *StaticEntDBImpl) ListImportersOf(pkgPath string) ([]*dos.Package, error)
ListImportersOf 获取导入指定包的所有包
func (*StaticEntDBImpl) SaveFuncEdge ¶
func (s *StaticEntDBImpl) SaveFuncEdge(edge *dos.FuncEdge) error
SaveFuncEdge 保存函数调用关系
func (*StaticEntDBImpl) SaveFuncNode ¶
func (s *StaticEntDBImpl) SaveFuncNode(node *dos.FuncNode) error
SaveFuncNode 保存函数节点
func (*StaticEntDBImpl) SavePackage ¶ added in v1.2.1
func (s *StaticEntDBImpl) SavePackage(packageInfo *dos.Package) error
SavePackage 保存包信息
func (*StaticEntDBImpl) SavePackageDep ¶ added in v1.2.1
func (s *StaticEntDBImpl) SavePackageDep(dep *dos.PackageDep) error
SavePackageDep 保存包依赖关系
func (*StaticEntDBImpl) SearchFuncNodes ¶ added in v1.1.6
SearchFuncNodes 模糊搜索函数节点
func (*StaticEntDBImpl) SearchPackages ¶ added in v1.2.1
SearchPackages 模糊搜索包
type TraceEntDB ¶
type TraceEntDB struct {
// contains filtered or unexported fields
}
TraceEntDB 使用 Ent 框架的跟踪数据库
func NewTraceEntDB ¶
func NewTraceEntDB(dbPath string) (*TraceEntDB, error)
NewTraceEntDB 创建跟踪数据库(使用 Ent 框架)
func (*TraceEntDB) GetActiveGoroutineCount ¶ added in v1.2.0
func (d *TraceEntDB) GetActiveGoroutineCount() (int, error)
GetActiveGoroutineCount 获取活跃Goroutine数量
func (*TraceEntDB) GetAllFunctionName ¶
func (d *TraceEntDB) GetAllFunctionName() ([]string, error)
GetAllFunctionName 获取所有函数名
func (*TraceEntDB) GetAllGIDs ¶
func (d *TraceEntDB) GetAllGIDs(page int, limit int) ([]dos.GoroutineTrace, error)
GetAllGIDs 获取所有的 GID,支持分页
func (*TraceEntDB) GetAllParentFunctions ¶ added in v1.1.3
func (d *TraceEntDB) GetAllParentFunctions(functionName string) ([]*dos.Function, error)
GetAllParentIds 获取所有的父函数 ID
func (*TraceEntDB) GetAllTraceTimeCosts ¶ added in v1.2.0
func (d *TraceEntDB) GetAllTraceTimeCosts() ([]string, error)
GetAllTraceTimeCosts 获取所有跟踪数据的时间消耗
func (*TraceEntDB) GetCalleeFunctions ¶
func (d *TraceEntDB) GetCalleeFunctions(functionName string) ([]string, error)
GetCalleeFunctions 获取被指定函数调用的函数列表
func (*TraceEntDB) GetCallerFunctions ¶
func (d *TraceEntDB) GetCallerFunctions(functionName string) ([]string, error)
GetCallerFunctions 获取调用指定函数的函数列表
func (*TraceEntDB) GetChildFunctions ¶
func (d *TraceEntDB) GetChildFunctions(parentId int64) ([]*dos.Function, error)
GetChildFunctions 获取函数的子函数
func (*TraceEntDB) GetFunctionAnalysis ¶
func (d *TraceEntDB) GetFunctionAnalysis(functionName string, queryType string) ([]dos.FunctionNode, error)
GetFunctionAnalysis 获取函数调用关系分析
func (*TraceEntDB) GetFunctionCallDepths ¶
func (d *TraceEntDB) GetFunctionCallDepths(functionName string) ([]int, error)
GetFunctionCallDepths 获取指定函数在各种调用中的调用深度
func (*TraceEntDB) GetFunctionInfoInGoroutine ¶ added in v1.2.0
func (d *TraceEntDB) GetFunctionInfoInGoroutine(gid uint64, targetFunctionId int64) (*dos.FunctionInfo, error)
GetFunctionInfoInGoroutine 获取函数在指定Goroutine中的信息
func (*TraceEntDB) GetGidsByFunctionName ¶
func (d *TraceEntDB) GetGidsByFunctionName(functionName string) ([]string, error)
GetGidsByFunctionName 根据函数名获取 GID 列表
func (*TraceEntDB) GetGoroutineByGID ¶ added in v1.2.0
func (d *TraceEntDB) GetGoroutineByGID(gid int64) (*dos.GoroutineTrace, error)
GetGoroutineByGID 根据 GID 获取单个 Goroutine 信息
func (*TraceEntDB) GetGoroutineCallDepth ¶
func (d *TraceEntDB) GetGoroutineCallDepth(gid uint64) (int, error)
GetGoroutineCallDepth 获取指定 Goroutine 的最大调用深度
func (*TraceEntDB) GetGoroutineExecutionTime ¶
func (d *TraceEntDB) GetGoroutineExecutionTime(gid uint64) (string, error)
GetGoroutineExecutionTime 获取指定 Goroutine 的总执行时间
func (*TraceEntDB) GetHotFunctions ¶
func (d *TraceEntDB) GetHotFunctions(sortBy string) ([]dos.Function, error)
GetHotFunctions 获取热点函数分析数据
func (*TraceEntDB) GetInitialFunc ¶
func (d *TraceEntDB) GetInitialFunc(gid uint64) (string, error)
GetInitialFunc 获取初始函数
func (*TraceEntDB) GetLastFunction ¶
func (d *TraceEntDB) GetLastFunction() (*dos.TraceData, error)
func (*TraceEntDB) GetMaxCallDepth ¶ added in v1.2.0
func (d *TraceEntDB) GetMaxCallDepth() (int, error)
GetMaxCallDepth 获取最大调用深度
func (*TraceEntDB) GetParamsByID ¶
func (d *TraceEntDB) GetParamsByID(id int32) ([]dos.TraceParams, error)
GetParamsByID 根据 ID 获取参数
func (*TraceEntDB) GetSampledFunctionNames ¶ added in v1.2.0
func (d *TraceEntDB) GetSampledFunctionNames(maxSamples int32) ([]string, error)
GetSampledFunctionNames 获取采样后的函数名称列表
func (*TraceEntDB) GetTotalGIDs ¶
func (d *TraceEntDB) GetTotalGIDs() (int, error)
GetTotalGIDs 获取 GID 总数
func (*TraceEntDB) GetTraceByID ¶
func (d *TraceEntDB) GetTraceByID(id int) (*dos.TraceData, error)
GetTraceByID 根据 ID 获取跟踪数据
func (*TraceEntDB) GetTraceChildren ¶
func (d *TraceEntDB) GetTraceChildren(parentID int64) ([]dos.TraceData, error)
GetTraceChildren 获取跟踪数据的子节点
func (*TraceEntDB) GetTracesByFuncName ¶
func (d *TraceEntDB) GetTracesByFuncName(functionName string) ([]dos.TraceData, error)
GetTracesByFuncName 获取指定函数名的所有跟踪数据
func (*TraceEntDB) GetTracesByGID ¶
func (d *TraceEntDB) GetTracesByGID(gid uint64, depth int, createTime string) ([]dos.TraceData, error)
GetTracesByGID 根据 GID 获取跟踪数据
func (*TraceEntDB) GetTracesByParentId ¶
func (d *TraceEntDB) GetTracesByParentId(parentId int64) ([]dos.TraceData, error)
GetTracesByParentId 根据父函数 ID 查询函数调用
func (*TraceEntDB) IsGoroutineFinished ¶
func (d *TraceEntDB) IsGoroutineFinished(gid uint64) (bool, error)
IsGoroutineFinished 检查指定的goroutine是否已完成