sqlite

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileEntDB

func NewFileEntDB(conf *conf.Data) (repo.FileRepo, error)

NewFileEntDB 创建文件数据库管理实例(使用 Ent 框架)

func ParseDBPath

func ParseDBPath(dbPath string) string

ParseDBPath 解析数据库路径

Types

type FileEntDB

type FileEntDB struct {
	// contains filtered or unexported fields
}

FileEntDB 使用 Ent 框架的文件数据库管理结构

func (*FileEntDB) Close

func (f *FileEntDB) Close() error

Close 关闭数据库连接

func (*FileEntDB) DeleteFileInfo

func (f *FileEntDB) DeleteFileInfo(id int64) error

DeleteFileInfo 删除文件信息

func (*FileEntDB) GetFileInfoByID

func (f *FileEntDB) GetFileInfoByID(id int64) (*entity.FileInfo, error)

GetFileInfoByID 根据ID获取文件信息

func (*FileEntDB) ListFileInfos

func (f *FileEntDB) ListFileInfos(fileType entity.FileType, limit int, offset int) ([]*entity.FileInfo, error)

ListFileInfos 获取文件信息列表

func (*FileEntDB) SaveFileInfo

func (f *FileEntDB) SaveFileInfo(info *entity.FileInfo) error

SaveFileInfo 保存文件信息

type StaticEntDBImpl

type StaticEntDBImpl struct {
	// contains filtered or unexported fields
}

StaticEntDBImpl 使用 Ent 框架的静态分析数据库实现

func NewStaticEntDBImpl

func NewStaticEntDBImpl(dbPath string) (*StaticEntDBImpl, error)

NewStaticEntDBImpl 创建函数节点数据库(使用 Ent 框架)

func (*StaticEntDBImpl) Close

func (s *StaticEntDBImpl) Close() error

Close 关闭数据库连接

func (*StaticEntDBImpl) GetAllFuncEdges

func (s *StaticEntDBImpl) GetAllFuncEdges() ([]*entity.FuncEdge, error)

GetAllFuncEdges 获取所有函数调用边

func (*StaticEntDBImpl) GetAllFuncNodes

func (s *StaticEntDBImpl) GetAllFuncNodes() ([]*entity.FuncNode, error)

GetAllFuncNodes 获取所有函数节点

func (*StaticEntDBImpl) GetCalleeEdges

func (s *StaticEntDBImpl) GetCalleeEdges(callerKey string) ([]*entity.FuncNode, error)

GetCalleeEdges 获取该函数调用的所有节点

func (*StaticEntDBImpl) GetCallerEdges

func (s *StaticEntDBImpl) GetCallerEdges(calleeKey string) ([]*entity.FuncNode, error)

GetCallerEdges 获取调用该函数的所有节点

func (*StaticEntDBImpl) GetFuncNodeByKey

func (s *StaticEntDBImpl) GetFuncNodeByKey(key string) (*entity.FuncNode, error)

GetFuncNodeByKey 根据Key获取函数节点

func (*StaticEntDBImpl) InitTable

func (s *StaticEntDBImpl) InitTable() error

InitTable 初始化数据库表

func (*StaticEntDBImpl) SaveFuncEdge

func (s *StaticEntDBImpl) SaveFuncEdge(edge *entity.FuncEdge) error

SaveFuncEdge 保存函数调用关系

func (*StaticEntDBImpl) SaveFuncNode

func (s *StaticEntDBImpl) SaveFuncNode(node *entity.FuncNode) error

SaveFuncNode 保存函数节点

type TraceEntDB

type TraceEntDB struct {
	// contains filtered or unexported fields
}

TraceEntDB 使用 Ent 框架的跟踪数据库

func NewTraceEntDB

func NewTraceEntDB(dbPath string) (*TraceEntDB, error)

NewTraceEntDB 创建跟踪数据库(使用 Ent 框架)

func (*TraceEntDB) Close

func (d *TraceEntDB) Close() error

Close 关闭数据库连接

func (*TraceEntDB) GetAllFunctionName

func (d *TraceEntDB) GetAllFunctionName() ([]string, error)

GetAllFunctionName 获取所有函数名

func (*TraceEntDB) GetAllGIDs

func (d *TraceEntDB) GetAllGIDs(page int, limit int) ([]entity.GoroutineTrace, error)

GetAllGIDs 获取所有的 GID,支持分页

func (*TraceEntDB) GetAllParentIds

func (d *TraceEntDB) GetAllParentIds() ([]int64, error)

GetAllParentIds 获取所有的父函数 ID

func (*TraceEntDB) GetAllUnfinishedFunctions

func (d *TraceEntDB) GetAllUnfinishedFunctions(threshold int64) ([]entity.AllUnfinishedFunction, error)

GetAllUnfinishedFunctions 获取所有未完成的函数

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) ([]string, error)

GetChildFunctions 获取函数的子函数

func (*TraceEntDB) GetFunctionAnalysis

func (d *TraceEntDB) GetFunctionAnalysis(functionName string, queryType string) ([]entity.FunctionNode, error)

GetFunctionAnalysis 获取函数调用关系分析

func (*TraceEntDB) GetFunctionCallDepths

func (d *TraceEntDB) GetFunctionCallDepths(functionName string) ([]int, error)

GetFunctionCallDepths 获取指定函数在各种调用中的调用深度

func (*TraceEntDB) GetFunctionCallGraph

func (d *TraceEntDB) GetFunctionCallGraph(functionName string, depth int, direction string) (*entity.FunctionCallGraph, error)

GetFunctionCallGraph 获取函数调用关系图

func (*TraceEntDB) GetGidsByFunctionName

func (d *TraceEntDB) GetGidsByFunctionName(functionName string) ([]string, error)

GetGidsByFunctionName 根据函数名获取 GID 列表

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) GetGoroutineStats

func (d *TraceEntDB) GetGoroutineStats() (*entity.GoroutineStats, error)

GetGoroutineStats 获取 Goroutine 统计信息

func (*TraceEntDB) GetHotFunctions

func (d *TraceEntDB) GetHotFunctions(sortBy string) ([]entity.HotFunction, error)

GetHotFunctions 获取热点函数分析数据

func (*TraceEntDB) GetInitialFunc

func (d *TraceEntDB) GetInitialFunc(gid uint64) (string, error)

GetInitialFunc 获取初始函数

func (*TraceEntDB) GetLastFunction

func (d *TraceEntDB) GetLastFunction() (*entity.TraceData, error)

func (*TraceEntDB) GetParamsByID

func (d *TraceEntDB) GetParamsByID(id int32) ([]functrace.TraceParams, error)

GetParamsByID 根据 ID 获取参数

func (*TraceEntDB) GetTotalGIDs

func (d *TraceEntDB) GetTotalGIDs() (int, error)

GetTotalGIDs 获取 GID 总数

func (*TraceEntDB) GetTraceByID

func (d *TraceEntDB) GetTraceByID(id int) (*entity.TraceData, error)

GetTraceByID 根据 ID 获取跟踪数据

func (*TraceEntDB) GetTraceChildren

func (d *TraceEntDB) GetTraceChildren(parentID int64) ([]entity.TraceData, error)

GetTraceChildren 获取跟踪数据的子节点

func (*TraceEntDB) GetTracesByFuncName

func (d *TraceEntDB) GetTracesByFuncName(functionName string) ([]entity.TraceData, error)

GetTracesByFuncName 获取指定函数名的所有跟踪数据

func (*TraceEntDB) GetTracesByGID

func (d *TraceEntDB) GetTracesByGID(gid uint64) ([]entity.TraceData, error)

GetTracesByGID 根据 GID 获取跟踪数据

func (*TraceEntDB) GetTracesByParentId

func (d *TraceEntDB) GetTracesByParentId(parentId int64) ([]entity.TraceData, error)

GetTracesByParentId 根据父函数 ID 查询函数调用

func (*TraceEntDB) IsGoroutineFinished

func (d *TraceEntDB) IsGoroutineFinished(gid uint64) (bool, error)

IsGoroutineFinished 检查指定的goroutine是否已完成

Jump to

Keyboard shortcuts

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