Documentation
¶
Index ¶
- type DepType
- type File
- type FileType
- type Module
- func (m *Module) AddPackage(p *Package)
- func (m *Module) AddVersion(version string)
- func (m *Module) AddVersions(versions []string)
- func (m *Module) CalculateComplexity() float32
- func (m *Module) Files() int
- func (m *Module) GetPackage(name string) (*Package, bool)
- func (m *Module) GetVersions() []string
- func (m *Module) Latest() string
- func (m *Module) Lines() int
- func (m *Module) LoadSource() error
- type Overview
- type Package
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Name string // file name, not including the path Imports []*Package // list of imported packages Package *Package // reference to the package this file belongs to Module *Module // reference to the module Type FileType // contains filtered or unexported fields }
func (*File) AddImport ¶
AddImport adds an import to the file it should find the module we're importing from and the package and add it to the file's imports
func (*File) CalculateComplexity ¶
CalculateComplexity walks the AST of a Go file to calculate its cyclomatic complexity.
type Module ¶
type Module struct { Path string // module path ie. github.com/perbu/gogrok Location string // file path Dependencies []*Module // list of dependencies Packages []*Package // list of packages in the module Type DepType // either a local (on-disk) or external (remote) module Repo *Repo // reference to the repo ReverseModuleDependencies []*Module // List of modules that depend on this module // contains filtered or unexported fields }
func (*Module) AddPackage ¶
func (*Module) AddVersion ¶
func (*Module) AddVersions ¶
func (*Module) CalculateComplexity ¶
func (*Module) GetVersions ¶
func (*Module) LoadSource ¶
LoadSource loads the source code for a local module.
type Overview ¶
type Overview struct { Modules int Packages int Files int LoC int OutdatedModules int SecurityProblems int }
Overview type provides a high-level overview of the repo
type Package ¶
type Package struct { Name string // package name Location string // file path, relative to the module Module *Module // reference to the module ReverseDependencies []*Package // list of packages that depend on this package // contains filtered or unexported fields }
func (*Package) CalculateComplexity ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) FindModule ¶
FindModule finds a module from a full import path. It works by checking the module directory. If the module is not found it will chop off the last part of the path and try again.
func (*Repo) GetModuleNames ¶
Click to show internal directories.
Click to hide internal directories.