Documentation
¶
Index ¶
- func AddConst(data *Package, node *doc.Value, path string)
- func AddExample(data *Package, node *doc.Example, path string)
- func AddFunc(data *Package, node *doc.Func, path string)
- func AddFuncExample(data *Func, node *doc.Example, path string)
- func AddType(data *Package, node *doc.Type, path string)
- func AddTypeExample(data *Type, node *doc.Example, path string)
- func AddTypeFunc(data *Type, node *doc.Func, path string)
- func AddTypeMethod(data *Type, node *doc.Func, path string)
- func AddVar(data *Package, node *doc.Value, path string)
- func GetDirectories(path string) []string
- func GetGoFiles(path string) []*ast.File
- func GetGoFilesInDir(path string) []*ast.File
- func GetPackageDocumentation(packageFilePath, packageImportPath string) (*doc.Package, error)
- func GetPackagesDataFromDirRecursive(dirPath string, includeRoot bool, rootImportPath string) (map[string]*Package, error)
- func ParseGoMod(pkg *Package, path string) error
- func ParseGoModFile(module *Module, path string) error
- func SeekGoMod(pkg *Package, path string, levels int) error
- type Const
- type Example
- type Func
- type FuncVar
- type Module
- type Package
- type Type
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConst ¶
AddConst parses *doc.Value that contains constants data and appends a new Var struct to the provided data *Package.
func AddExample ¶
AddVar parses *doc.Example containing example data and appends a new *Example to the provided data *Package.
func AddFuncExample ¶
AddFuncExample parses *doc.Example containing example data and appends a new *Example to the provided data *Package.
func AddTypeExample ¶
AddTypeExample parses *doc.Example containing example data and appends a new *Example to the provided data *Package.
func AddTypeFunc ¶
AddTypeFunc parses *doc.Func from a *doc.Type and appends a new *Func to the provided data *Package.
func AddTypeMethod ¶
AddTypeMethod parses *doc.Func from a *doc.Type and appends a new *Func to the provided data *Package.
func AddVar ¶
AddVar parses *doc.Value that contains variables data and appends a new Var struct to the provided data *Package.
func GetDirectories ¶
func GetGoFiles ¶
func GetGoFilesInDir ¶
func GetPackageDocumentation ¶
func GetPackagesDataFromDirRecursive ¶
func GetPackagesDataFromDirRecursive(dirPath string, includeRoot bool, rootImportPath string) (map[string]*Package, error)
GetPackagesDataFromDirRecursive parses all the .go files in the directories in the path recursively and returns them as a map[string]*Package with path as key.
func ParseGoMod ¶
ParseGoMod parses a go.mod file and fills the data in the provided *Package.
func ParseGoModFile ¶
ParseGoModFile parses a go.mod file.
Types ¶
type Func ¶
type Func struct { Name string Definition string Recv FuncVar Params []FuncVar Results []FuncVar Doc string Examples []*Example Filename string Line int }
Func holds function data.
func (*Func) FormatParams ¶ added in v0.0.3
FormatParams returns function parameters with names removed.
func (*Func) FormatParamsBrackets ¶ added in v0.0.3
FormatParams returns function parameters in brackets with names removed.
func (*Func) FormatResults ¶ added in v0.0.3
FormatResults returns function results with names removed.
func (*Func) FormatResultsBrackets ¶ added in v0.0.3
FormatResultsBrackets returns function results with names removed in brackets.
func (*Func) GetHeadingHREF ¶ added in v0.0.3
GetHeadingHREF returns function definition, formated as a name for a relative link.
type Module ¶
type Module struct { Name string `json:"name" yaml:"name"` GoVersion string `json:"go_version" yaml:"go_version"` Heading string `json:"heading" yaml:"heading"` Overview string `json:"overview" yaml:"overview"` ImportPath string `json:"import_path" yaml:"import_path"` Submodules map[string]*Package `json:"submodules" yaml:"submodules"` }
Module holds module info.
func ParseModule ¶
ParseModule parses a go module in the provided path and returns a *Module.
type Package ¶
type Package struct { ImportPath string Name string Definition string Doc string Subpackages map[string]*Package Examples []*Example Funcs []*Func Types []*Type Constants []*Const Vars []*Var CustomVars map[string]string Path string PathAbs string ShowName bool ShowDoc bool ShowExamples bool ShowIndex bool ShowFuncs bool ShowTypes bool ShowConsts bool ShowVars bool ShowSubpackages bool ShowOverview bool ShowImportPath bool }
Package holds package data for use in templates.
func GetPackageDataFromDir ¶
GetPackageDataFromDirRecursive parses all the .go files in the provided directory.
func GetPackageDataFromDirRecursive ¶
GetPackageDataFromDirRecursive parses all the .go files in the path recursively.
func ParsePackage ¶
ParsePackage parses go files in a directory and returns a *Package.
func (Package) PathIndent ¶ added in v0.0.8
PathIdent returns 2 spaces for every '/' character in the path.