Documentation
¶
Index ¶
- Constants
- Variables
- func GenConfig(name string) (pkg.File, error)
- func GenModelEntities(name string, tables []*Table) ([]pkg.File, error)
- func GenModels(name, src string, tree *pkg.Tree) ([]pkg.File, error)
- func GenRepository(name string) (pkg.File, error)
- func GenRestApis(name, src string, tree *pkg.Tree) ([]pkg.File, error)
- func GenRestMain(name string) (pkg.File, error)
- func GenRpcApis(name, src string, tree *pkg.Tree) ([]pkg.File, error)
- func GenRpcMain(name string) (pkg.File, error)
- func GenRpcProtos(name, src, dst string, tree *pkg.Tree) ([]pkg.File, error)
- func GenServices(name, src string, tree *pkg.Tree) ([]pkg.File, error)
- func MkdirDirs(dst string) error
- type Column
- type MethodTemplateVars
- type ServiceTemplateVars
- type Table
Constants ¶
View Source
const ( SQL_FOMATE_TABLES = "SELECT TABLE_NAME as name, TABLE_COMMENT as comment FROM information_schema.TABLES WHERE table_schema='%s'" SQL_FOMATE_TABLE_DETAIL = "" /* 153-byte string literal not displayed */ )
Variables ¶
View Source
var ( FlagServerType string FlagCodesDst string FlagProtoFile string FlagMysqlHost string FlagMysqlDatabase string FlagMysqlAuth string PackageName string Cmd = &cobra.Command{ Use: "server", Short: "Generate server code", Run: run, } )
View Source
var MysqlTypes = map[string]string{
"tinyint": "int8",
"tinyint unsigned": "uint8",
"smallint": "int16",
"smallint unsigned": "uint16",
"integer": "int64",
"int": "int",
"int unsigned": "uint",
"bigint": "int64",
"bigint unsigned": "uint64",
"float": "float32",
"float unsigned": "float32",
"double": "float64",
"decimal": "float64",
"varchar": "string",
"char": "string",
"date": "string",
"time": "string",
"datetime": "string",
"timestamp": "string",
"json": "datatypes.JSON",
"text": "[]byte",
"tinytext": "[]byte",
"mediumtext": "[]byte",
"longtext": "[]byte",
"blob": "[]byte",
"tinyblob": "[]byte",
"mediumblob": "[]byte",
"longblob": "[]byte",
"enum": "string",
}
Functions ¶
Types ¶
type MethodTemplateVars ¶
type ServiceTemplateVars ¶
type ServiceTemplateVars struct { ServerName string // 服务名 (go mod name、registry name) Name string // 模块名称 Document string // 模块文档 Methods []*MethodTemplateVars }
Click to show internal directories.
Click to hide internal directories.