parser

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parser

func Parser(options *Options) error

func ParserToString

func ParserToString(options *Options) (string, error)

Types

type FileInfo

type FileInfo struct {
	FilePath   string
	GenPath    string
	DirName    string
	StructList []*StructInfo
}

type Options

type Options struct {
	InputFile string
	OutputDir string
	Sql       string

	MysqlDsn   string
	MysqlTable string
}

type ReadFromFile

type ReadFromFile struct {
	// contains filtered or unexported fields
}

func (*ReadFromFile) GetStructList

func (r *ReadFromFile) GetStructList() ([]*StructInfo, error)

type ReadFromMySQL

type ReadFromMySQL struct {
	// contains filtered or unexported fields
}

func (*ReadFromMySQL) GetStructList

func (r *ReadFromMySQL) GetStructList() ([]*StructInfo, error)

type ReadFromSQL

type ReadFromSQL struct {
	// contains filtered or unexported fields
}

func (*ReadFromSQL) GetStructList

func (r *ReadFromSQL) GetStructList() ([]*StructInfo, error)

type Reader

type Reader interface {
	GetStructList() ([]*StructInfo, error)
}

func NewReader

func NewReader(options *Options) Reader

type ShowTable

type ShowTable struct {
	Table       string `gorm:"Table"`
	CreateTable string `gorm:"column:Create Table"`
}

type StructInfo

type StructInfo struct {
	Name   string
	Fields []StructInfoField
}

func ParseSql

func ParseSql(sql string) ([]*StructInfo, error)

type StructInfoField

type StructInfoField struct {
	FieldName    string
	FieldType    string
	FieldComment string
}

Jump to

Keyboard shortcuts

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