parser

package
v0.0.0-...-f260a3c Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDirectory

func ParseDirectory(path, gopath string) (map[string]Package, error)

func ParsePackage

func ParsePackage(gopath, path string) (map[string]Package, error)

Types

type Package

type Package struct {
	Name string
	Path string

	Types     map[string]types.Type
	Functions map[string]types.FuncType
	// contains filtered or unexported fields
}

func NewPackage

func NewPackage(pkg *ast.Package, path string) (*Package, error)

func (*Package) FindModelByName

func (pkg *Package) FindModelByName(
	name string,
	unwrapper func(types.ImportedType) (types.Type, error),
) (types.Type, error)

func (*Package) GetServices

func (pkg *Package) GetServices() map[string]types.Type

type Parser

type Parser struct {
	GOPATH      string
	InitialPath string

	Spec *types.OpenAPISpec
	// contains filtered or unexported fields
}

func New

func New(path, gopath string) (*Parser, error)

func (*Parser) FindCall

func (parser *Parser) FindCall(fun types.FuncType, t types.Type) *types.Call

func (*Parser) FindMethod

func (parser *Parser) FindMethod(selector ast.SelectorExpr) types.FuncType

func (*Parser) FindModel

func (parser *Parser) FindModel(selector ast.SelectorExpr) types.Type

func (*Parser) GenerateDocs

func (parser *Parser) GenerateDocs(path string) (*types.OpenAPISpec, error)

func (*Parser) GetPackage

func (parser *Parser) GetPackage(name string) (*Package, error)

func (*Parser) GetPackages

func (parser *Parser) GetPackages() map[string]Package

func (*Parser) ParseService

func (parser *Parser) ParseService(prefix string, model types.Type) error

func (*Parser) UnwrapImportedType

func (parser *Parser) UnwrapImportedType(s types.ImportedType) (types.Type, error)

Jump to

Keyboard shortcuts

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