Documentation
¶
Overview ¶
Package godoc implements the core logic for retrieving and parsing Go documentation.
Index ¶
Constants ¶
View Source
const ( TypeFunction = "function" TypeType = "type" TypeMethod = "method" TypeVar = "var" TypeConst = "const" )
Symbol types for Doc
Variables ¶
This section is empty.
Functions ¶
func ListSubPackages ¶
ListSubPackages finds sub-packages within a directory using go list.
Types ¶
type Doc ¶
type Doc struct {
Package string `json:"package"`
ImportPath string `json:"importPath"`
ResolvedPath string `json:"resolvedPath,omitempty"`
SymbolName string `json:"symbolName,omitempty"`
Type string `json:"type,omitempty"` // "function", "type", "var", "const"
Definition string `json:"definition,omitempty"`
Description string `json:"description"`
Examples []Example `json:"examples,omitempty"`
SubPackages []string `json:"subPackages,omitempty"`
PkgGoDevURL string `json:"pkgGoDevURL"`
// Lists of symbols (signatures or summaries)
Funcs []string `json:"funcs,omitempty"`
Types []string `json:"types,omitempty"`
Vars []string `json:"vars,omitempty"`
Consts []string `json:"consts,omitempty"`
// Extra fields for Describe superset
SourcePath string `json:"sourcePath,omitempty"`
Line int `json:"line,omitempty"`
References []string `json:"references,omitempty"`
}
Doc represents the parsed documentation.
func LoadWithFallback ¶
LoadWithFallback attempts to resolve an import path and return documentation. It attempts to find parent packages if the exact match fails.
func (*Doc) RenderJSON ¶ added in v0.26.0
RenderJSON marshals the Doc into formatted JSON.
func (*Doc) RenderMarkdown ¶ added in v0.26.0
RenderMarkdown converts a Doc to Markdown.
Click to show internal directories.
Click to hide internal directories.