parse

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Package string
	TFErr   bool
	Mod     string
	ORM     string
	WEB     string
}

type Field

type Field struct {
	DBName      string // database name
	FieldName   string // field name
	HumpName    string // hump name
	Type        string // field type
	IsBaseModel bool   // base model field
	IsUnique    bool   // is unique true
}

Field struct field detail

type Parser

type Parser struct {
	Filepath      string
	Structs       []*StructData
	Files         map[string]*ast.File // key: filename value: ast.File
	CacheFileByte map[string][]byte
	// contains filtered or unexported fields
}

parser

func NewParser

func NewParser(f string) *Parser

NewParser new

func (*Parser) ParserFile

func (p *Parser) ParserFile() (err error)

ImportDir 导入文件并获取go文件

func (*Parser) ParserStruct

func (p *Parser) ParserStruct() (err error)

ParserStruct 解析结构体数据

type StructData

type StructData struct {
	Config
	StructDetail string // struct detail
	StructName   string // struct name
	LowerName    string
	Fields       []*Field // struct field
}

StructData struct data

Jump to

Keyboard shortcuts

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