Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
Id string // 唯一标志
Name string // 名称
Type string // 类型,包含包导入路径
Doc string // 文档
Comment string // 注释
}
Field 字段
type IStruct ¶
type IStruct interface {
Demo(in types.Array) types.Basic
MakeInterface() string
String(f Field, ip importpath.ImportPath)
TypeAlias(p Field, ip importpath.ImportPath)
}
type ImportPathAlias ¶
type ImportPathAlias = importpath.ImportPath
type Option ¶
type Option struct {
Filter func(os.FileInfo) bool // 过滤器
UseSourceImporter bool // 使用源码importer
ReplaceImportPath bool // 替换导入路径
FromPath string
ToPath string
Output io.Writer
}
Option 选项
type Parser ¶
type Parser struct {
PkgInfo
// contains filtered or unexported fields
}
Parser 解析器 解析指定的包导入路径,获取go源码信息
func (*Parser) GetPkgInfo ¶
type PkgInfo ¶
type PkgInfo struct {
// contains filtered or unexported fields
}
func (PkgInfo) GetPkgName ¶
type Struct ¶
type Struct struct {
// 如:github.com/pkg/errors
PkgPath string // 包路径
// 如: errors
PkgName string // 包名
Field
Fields []Field // 字段列表
Methods []Method // 方法列表
}
Struct 结构体
func (Struct) String ¶
func (s Struct) String(f Field, ip importpath.ImportPath)
让它传入本包里的另外一个结构体 传入本项目其它包的结构体
func (Struct) TypeAlias ¶
func (s Struct) TypeAlias(p IIIIIIIInfo, ip ImportPathAlias)
Click to show internal directories.
Click to hide internal directories.