ast

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImportFile

func AddImportFile(k, v string)

AddImportFile 添加自定义import文件列表

func EvalSymlinks(modPkg, modFile, objPkg string) string

EvalSymlinks Return to relative path . 通过module 游标返回包相对路径

func GetAstPackage

func GetAstPackage(objPkg, objFile string) (*ast.Package, bool)

GetAstPackage Parsing source file ast structure (with main restriction).解析源文件ast结构(带 main 限制)

func GetImportPkg

func GetImportPkg(i string) string

GetImportPkg 分析得出 pkg

func GetModuleInfo

func GetModuleInfo(n int) (string, string, bool)

GetModuleInfo 获取项目[module name] [根目录绝对地址]

func NewStructAnalysis

func NewStructAnalysis(modPkg, modFile string) *structAnalysis

NewStructAnalysis 新建一个导出结构体类

Types

type ControllerComment

type ControllerComment struct {
	TagName     string
	Route       string
	TokenHeader string
}

func AnalysisControllerFile added in v0.3.2

func AnalysisControllerFile(astPkg *ast.Package, controllerName string) (imports map[string]string, funcMap map[string]*ast.FuncDecl, comment *ControllerComment)

AnalysisControllerFile 处理控制器

Jump to

Keyboard shortcuts

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