source

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	PkgName     string
	Imports     []s2aModels.Import
	Funcs       s2aModels.Functions
	HTTPHandler models.HTTPHandlerInfo
	// contains filtered or unexported fields
}

Parser is a source code parser.

Uses the built-in AST features to parse the functions. Also parses the main package name, file imports, API HTTP handler information.

func NewSourceParser

func NewSourceParser() *Parser

NewSourceParser returns a new source code parser.

func (*Parser) Parse

func (p *Parser) Parse(pkgPath, handlerName string) error

Parse runs parsing.

Walks over every file in the package (and subpackages) and reads definitions of all the visited functions.

func (*Parser) Visit

func (p *Parser) Visit(node ast.Node) ast.Visitor

Visit implements the ast.Visitor interface.

Allows the SourceParser to walk over nodes in a parsed file.

Jump to

Keyboard shortcuts

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