analyzer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownRouters = map[string]string{
	"github.com/gin-gonic/gin": "New",
	"github.com/go-chi/chi/v5": "NewRouter",
	"net/http":                 "NewServeMux",
}

KnownRouters defines the constructor functions for popular routers. The key is the package path, the value is the function name.

Functions

This section is empty.

Types

type Analyzer

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

Analyzer holds the state for a single analysis run.

func New

func New(projectPath string, config *config.Config) (*Analyzer, error)

New creates and initializes a new Analyzer for the given project path.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze() (*model.APIModel, error)

Analyze performs the full analysis of the loaded packages using a single unified pass.

type ParsedComment

type ParsedComment struct {
	Summary     string
	Description string
	Tags        []string
}

ParsedComment holds the structured data extracted from a doc comment.

type SchemaGenerator

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

SchemaGenerator holds state for schema generation, like a cache for already-generated types.

func NewSchemaGenerator

func NewSchemaGenerator() *SchemaGenerator

func (*SchemaGenerator) GenerateSchemaRef

func (sg *SchemaGenerator) GenerateSchemaRef(typeObj types.Type) *openapi3.SchemaRef

GenerateSchemaRef creates a JSON Schema for a given Go type and adds it to the component map. It returns a reference to the schema.

Jump to

Keyboard shortcuts

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