Versions in this module Expand all Collapse all v1 v1.1.0 Aug 20, 2020 v1.0.0 Dec 5, 2017 Changes in this version + var ErrNotStructType = errors.New("type is not ast.StructType") + func ExprToBaseTypeName(expr ast.Expr) (string, error) + func ExprToTypeName(expr ast.Expr) (string, error) + func GetKeys(tag string) []string + func IsReferenceToOtherPackage(expr ast.Expr) (bool, string) + type FieldInfo ast.Field + func (f *FieldInfo) IsArray() bool + func (f *FieldInfo) IsArrayPtr() bool + func (f *FieldInfo) IsBool() bool + func (f *FieldInfo) IsFloat32() bool + func (f *FieldInfo) IsFloat64() bool + func (f *FieldInfo) IsInt() bool + func (f *FieldInfo) IsInt64() bool + func (f *FieldInfo) IsNumber() bool + func (f *FieldInfo) IsPtr() bool + func (f *FieldInfo) IsPtrArray() bool + func (f *FieldInfo) IsPtrArrayPtr() bool + func (f *FieldInfo) IsString() bool + func (f *FieldInfo) IsTime() bool + func (f *FieldInfo) TypeName() string + type FieldInfos []*FieldInfo + type FileInfo ast.File + func (file *FileInfo) AstFile() *ast.File + func (file *FileInfo) FindImportSpecByIdent(packageIdent string) *ast.ImportSpec + type FileInfos []*FileInfo + func (files FileInfos) AstFiles() []*ast.File + type Generator struct + Buf bytes.Buffer + Package *PackageInfo + RequiredImports []*Import + func NewGenerator(pkg *PackageInfo) *Generator + func (g *Generator) AddImport(path string, ident string) + func (g *Generator) Format() ([]byte, error) + func (g *Generator) PrintHeader(cmdName string, args *[]string) + func (g *Generator) Printf(format string, args ...interface{}) + type Import struct + Ident string + Path string + type PackageInfo struct + Dir string + Files FileInfos + Types *types.Package + func (pkg *PackageInfo) CollectTaggedTypeInfos(tag string) TypeInfos + func (pkg *PackageInfo) CollectTypeInfos(typeNames []string) TypeInfos + func (pkg *PackageInfo) Name() string + func (pkg *PackageInfo) TypeInfos() TypeInfos + type Parser struct + SkipSemanticsCheck bool + func (p *Parser) ParsePackageDir(directory string) (*PackageInfo, error) + func (p *Parser) ParsePackageFiles(fileNames []string) (*PackageInfo, error) + func (p *Parser) ParseStringSource(fileName string, code string) (*PackageInfo, error) + type StructTypeInfo ast.StructType + func (st *StructTypeInfo) AstStructType() *ast.StructType + func (st *StructTypeInfo) FieldInfos() FieldInfos + type TypeInfo struct + AnnotatedComment *ast.Comment + FileInfo *FileInfo + GenDecl *ast.GenDecl + TypeSpec *ast.TypeSpec + func (t *TypeInfo) Doc() *ast.CommentGroup + func (t *TypeInfo) Name() string + func (t *TypeInfo) StructType() (*StructTypeInfo, error) + type TypeInfos []*TypeInfo