Documentation ¶
Index ¶
- func FindTypes(v ast.Node) ast.Visitor
- func GetAllSubDirs(base string) (s []string)
- func GetFlags()
- func GetLocalRepos() (s []string)
- func InitLocalDB()
- func SetDefaults()
- func SortReturnImports(imports map[string]struct{}) (ret []string)
- type Application
- type FileInfo
- type FuncInfo
- type InterfaceInfo
- type Links
- type MethodInfo
- type PackageInfo
- type PkgImports
- type PkgNames
- type PkgStructInfo
- type StructInfo
- type VisitorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllSubDirs ¶
Recursively go to all sub-directories that are not starting with . and return back an array of string with the location of the folders
func GetLocalRepos ¶
func GetLocalRepos() (s []string)
Recursively go to all sub-directories that are not starting with . and return back an array of string with the location of the folders
func InitLocalDB ¶
func InitLocalDB()
func SetDefaults ¶
func SetDefaults()
func SortReturnImports ¶
Types ¶
type Application ¶
type Application struct { Name string `boltholdKey:"name"` BaseFolder string SubFolders []string LinesInApp int UniqueImports map[string]interface{} AllImports []string ImportCounts map[string]int ChildPackages []*PackageInfo ChildFiles []*FileInfo ChildStructs []*StructInfo ChildMethods []*MethodInfo ChildInterfaces []*InterfaceInfo ChildFuncs []*FuncInfo GraphData PkgImports }
func FetchApp ¶
func FetchApp(dir string) (RetApp Application)
Main function that reads the whole application
func NewApplication ¶
func NewApplication(baseFolder string) (RetApp Application)
func (*Application) CountUniqueImports ¶
func (a *Application) CountUniqueImports() int
func (*Application) GetUniqueImports ¶
func (a *Application) GetUniqueImports() (uImports []string)
func (*Application) ReadApp ¶
func (a *Application) ReadApp() (err error)
func (*Application) SortPackages ¶
func (a *Application) SortPackages()
Sort the packages based on the line size of the package
type FileInfo ¶
type FileInfo struct { Name string PathAndName string FileLocation string AstFile *ast.File NumberLines int Size int Structs []*StructInfo Methods []*MethodInfo Funcs []*FuncInfo Interfaces []*InterfaceInfo Imports []string HasMainFunc bool InitFuncCount int Lines []string PackageInfo *PackageInfo AstPackage *ast.Package Application *Application }
type FuncInfo ¶
type FuncInfo struct { Name string Content string //Role ComponentType NumberLines int Application *Application Package *PackageInfo File *FileInfo }
type InterfaceInfo ¶
type InterfaceInfo struct { Name string Content string StructName string NumberLines int Application *Application Package *PackageInfo Stuct *StructInfo File *FileInfo }
type MethodInfo ¶
type MethodInfo struct { Name string Content string StructName string NumberLines int Application *Application Package *PackageInfo Stuct *StructInfo File *FileInfo }
type PackageInfo ¶
type PackageInfo struct { Name string FolderLocation string PackageRef *ast.Package AstFiles map[string]*ast.File ParentApp *Application FileSet *token.FileSet ChildImports []string ChildFiles []*FileInfo ChildTests []*FileInfo ChildStructs []*StructInfo ChildMethods []*MethodInfo ChildInterfaces []*InterfaceInfo ChildFuncs []*FuncInfo Structs []string StructMethods []*PkgStructInfo `json:"package_struct_details"` }
func ParsePackage ¶
func ParsePackage(a *Application, fileSet *token.FileSet, folder string, pkg *ast.Package) (retPkg *PackageInfo)
Make a package - Loop over each file of the package and call LoadFile on the file
func (*PackageInfo) GetLinesInPkg ¶
func (p *PackageInfo) GetLinesInPkg() (lns int)
func (*PackageInfo) GetUniqueImports ¶
func (p *PackageInfo) GetUniqueImports() (uImports []string)
func (*PackageInfo) SortFiles ¶
func (p *PackageInfo) SortFiles()
func (*PackageInfo) TrackMethod ¶
func (p *PackageInfo) TrackMethod(info *MethodInfo)
func (*PackageInfo) UniqueImports ¶
func (p *PackageInfo) UniqueImports() int
type PkgImports ¶
type PkgNames ¶
type PkgNames struct { ID int `json:"id"` Value int `json:"value"` Label string `json:"label"` CountFiles int `json:"files_count"` CountFuncs int `json:"funcs_count"` CountInterfaces int `json:"interface_count"` CountStructs int `json:"structs_count"` CountMethods int `json:"methods_count"` CountImports int `json:"imports_count"` }
type PkgStructInfo ¶
type PkgStructInfo struct { StructName string `json:"struct_name"` MethodsCount int `json:"methods_count"` LinesInMethods int `json:"loc_struct_methods"` UniqueMethods map[string]interface{} `json:"unique_methods"` MethodToLoc map[string]int `json:"methods_loc"` MethodInfo []*MethodInfo `json:"-"` }
type StructInfo ¶
type StructInfo struct { Name string Content string //Role ComponentType NumberLines int Application *Application Package *PackageInfo File *FileInfo ChildMethods []*MethodInfo }
Click to show internal directories.
Click to hide internal directories.