Documentation ¶
Overview ¶
Package ast_parser get type information from a package using go/ast
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { Name string //字段名 PkgPath string //包路径 Type string //类型 CurrentTag string //main tag value Struct *Struct Tag reflect.StructTag //标签 Private bool //私有 Pointer bool //指针 Slice bool //slice IsStruct bool Docs []string //上方文档注释 Comment string //末尾的注释 EnumValue any // contains filtered or unexported fields }
type File ¶
type File struct { Name string //文件名 Imports []*importItem //导入 PkgPath string //包路径 Structs []*Struct //结构体 Docs []string //注释 }
File 文件
type Method ¶
type Method struct { Receiver *Receiver //接收器 PkgPath string //包路径 Name string //方法名称 Private bool Signature string //方法签名 Docs []string Params []*Field //函数参数 Results []*Field //函数返回值 }
Method 结构体方法
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Ignore ¶
Ignore a type by specified import path and type name
@param importPath @param t type name
func (*Parser) Parse ¶
Parse a type in a package
@param pkg package @param s type name @return error
func (*Parser) SetLogger ¶
func (p *Parser) SetLogger(logger parser_logger.ParserLogger)
Click to show internal directories.
Click to hide internal directories.