godoc

package
v0.0.0-...-f5ea262 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package godoc provides API documentation analysis capabilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer provides GoDoc coverage and quality analysis.

func NewAnalyzer

func NewAnalyzer(workingDir string) *Analyzer

NewAnalyzer creates a new GoDoc analyzer.

func (*Analyzer) AnalyzePackage

func (a *Analyzer) AnalyzePackage(ctx context.Context, packagePath string) (*PackageInfo, error)

AnalyzePackage analyzes a Go package for documentation coverage and quality.

type ConstantInfo

type ConstantInfo struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Value      string `json:"value"`
	Doc        string `json:"doc"`
	HasDoc     bool   `json:"has_doc"`
	IsExported bool   `json:"is_exported"`
	Line       int    `json:"line"`
}

ConstantInfo contains information about package constants.

type CoverageStats

type CoverageStats struct {
	TotalPublicSymbols  int     `json:"total_public_symbols"`
	DocumentedSymbols   int     `json:"documented_symbols"`
	UndocumentedSymbols int     `json:"undocumented_symbols"`
	CoveragePercentage  float64 `json:"coverage_percentage"`
	FunctionCoverage    float64 `json:"function_coverage"`
	TypeCoverage        float64 `json:"type_coverage"`
	VariableCoverage    float64 `json:"variable_coverage"`
	ConstantCoverage    float64 `json:"constant_coverage"`
	PackageDocumented   bool    `json:"package_documented"`
	ExampleCount        int     `json:"example_count"`
	ExamplesPerFunction float64 `json:"examples_per_function"`
}

CoverageStats contains documentation coverage statistics.

type ExampleInfo

type ExampleInfo struct {
	Name        string `json:"name"`
	ForFunction string `json:"for_function"`
	Code        string `json:"code"`
	Output      string `json:"output"`
	HasOutput   bool   `json:"has_output"`
}

ExampleInfo contains information about example functions.

type FieldInfo

type FieldInfo struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Doc        string `json:"doc"`
	HasDoc     bool   `json:"has_doc"`
	IsExported bool   `json:"is_exported"`
	Tag        string `json:"tag,omitempty"`
}

FieldInfo contains information about struct fields.

type FunctionInfo

type FunctionInfo struct {
	Name       string   `json:"name"`
	Signature  string   `json:"signature"`
	Doc        string   `json:"doc"`
	HasDoc     bool     `json:"has_doc"`
	IsExported bool     `json:"is_exported"`
	Line       int      `json:"line"`
	Examples   []string `json:"examples"`
	Complexity int      `json:"complexity"`
}

FunctionInfo contains information about a documented function.

type PackageInfo

type PackageInfo struct {
	ImportPath       string         `json:"importPath"`
	Name             string         `json:"name"`
	Dir              string         `json:"dir"`
	GoFiles          []string       `json:"goFiles"`
	PublicFunctions  []FunctionInfo `json:"publicFunctions"`
	PublicTypes      []TypeInfo     `json:"publicTypes"`
	PublicVariables  []VariableInfo `json:"publicVariables"`
	PublicConstants  []ConstantInfo `json:"publicConstants"`
	CoverageStats    CoverageStats  `json:"coverageStats"`
	QualityIssues    []QualityIssue `json:"qualityIssues"`
	ExampleFunctions []ExampleInfo  `json:"example_functions"`
	PackageDoc       string         `json:"package_doc"`
	HasPackageDoc    bool           `json:"has_package_doc"`
	Recommendations  []string       `json:"recommendations"`
}

PackageInfo contains documentation analysis information for a package.

type QualityIssue

type QualityIssue struct {
	Type       string `json:"type"`
	Severity   string `json:"severity"`
	Message    string `json:"message"`
	Symbol     string `json:"symbol"`
	File       string `json:"file"`
	Line       int    `json:"line"`
	Suggestion string `json:"suggestion"`
}

QualityIssue represents a documentation quality issue.

type TypeInfo

type TypeInfo struct {
	Name       string         `json:"name"`
	Kind       string         `json:"kind"`
	Doc        string         `json:"doc"`
	HasDoc     bool           `json:"has_doc"`
	IsExported bool           `json:"is_exported"`
	Line       int            `json:"line"`
	Methods    []FunctionInfo `json:"methods"`
	Fields     []FieldInfo    `json:"fields,omitempty"`
}

TypeInfo contains information about a documented type.

type VariableInfo

type VariableInfo struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Doc        string `json:"doc"`
	HasDoc     bool   `json:"has_doc"`
	IsExported bool   `json:"is_exported"`
	Line       int    `json:"line"`
}

VariableInfo contains information about package variables.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL