parse

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 11 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
	Separate     bool
	RemoveSource bool
	GenPkg       string
	Input        string
}

type Field

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

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 parse struct

func NewParser

func NewParser(f string) *Parser

NewParser new

func (*Parser) CheckExistFunc added in v1.0.7

func (p *Parser) CheckExistFunc(input string, b []byte) []byte

func (*Parser) ParserFile

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

ParserFile 导入文件并获取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
	PluralName   string
	LowerName    string
	HumpName     string
	PackageName  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