Documentation ¶
Overview ¶
Package model contains structures and constructors used by anticycle analyze functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analysis ¶
type Analysis struct { Cycles []*Pkg `json:"cycles"` Metadata *AnalysisMeta `json:"metadata"` }
Analysis holds final anticycle output.
type AnalysisMeta ¶
type AnalysisMeta struct {
Cycles [][]string `json:"cycles"`
}
AnalysisMeta is a metadata produced based on Analysis.
type Cycle ¶
type Cycle struct { AffectedImport *ImportInfo `json:"affectedImport"` AffectedFile string `json:"affectedFile"` }
Cycle holds information about affected file and import
type File ¶
type File struct { Path string `json:"path"` Imports []*ImportInfo `json:"imports"` }
File is a representation of source file with its path and list of imports.
type ImportInfo ¶
type ImportInfo struct { Name string `json:"name"` NameShort string `json:"nameShort"` Alias *string `json:"alias"` }
ImportInfo holds information about import statements.
func NewImportInfo ¶
func NewImportInfo(imp *ast.ImportSpec) *ImportInfo
NewImportInfo creates new ImportInfo from ast.ImportSpec. Will produce full name, short name and alias if exist.
type Pkg ¶
type Pkg struct { Name string `json:"name"` Path string `json:"path"` Imports map[string]*ImportInfo `json:"imports"` Files []*File `json:"files"` Cycles []*Cycle `json:"cycles,omitempty"` HaveCycle bool `json:"haveCycle"` }
Pkg is a higher level structure which has all information about its files and imports.
Click to show internal directories.
Click to hide internal directories.