Documentation ¶
Index ¶
- Constants
- func CarGen(name, dbName, grpcPath, grpcPkgName, distPath, distPkg string)
- func ConfigGen(genPath string)
- func CreateApiRouter(genPath string)
- func GormGen(path, dsn, name string, tables []string)
- func KitexGen(name, path string)
- func ModApiGen()
- func ModServerGen()
- func ModelToProtobuf(path, protoPkg, goPkg, modelPath, modelName string)
- type Config
- type FileInfo
- type Generator
- type ServiceField
- type ServiceFileInfo
- type TableInfo
Constants ¶
View Source
const ( GenGrpc = "grpc" GenDB = "database" GenDoc = "doc" GenRouter = "router" GenEnum = "enum" GenConfig = "config" )
View Source
const ( ConfigFileName = "config_origin.yaml" ConfigEncryptFileName = "config.yaml" )
Variables ¶
This section is empty.
Functions ¶
func ModServerGen ¶ added in v1.3.2
func ModServerGen()
func ModelToProtobuf ¶
func ModelToProtobuf(path, protoPkg, goPkg, modelPath, modelName string)
Types ¶
type Config ¶
type Config struct { Gen string //生成类型 Path string //基础项目路径 Name string //服务名 Des string //描述 Version string //版本 DbDsn string //数据库Dsn Tables string //数据表 ,隔开 DbName string //库别名 避免名称过长或者库名差异 DictTable string //字典表名 DictType string //字典类型字段名 DictName string //字典名称字段名 DictLabel string //字典标签字段名 DictValue string //字典值字段名 Out string //输出目录 }
type Generator ¶
type Generator struct { Model string PkgPath string PkgName string DistPath string DistPkg string DbName string ServiceFields []ServiceField MethodImports []string ServiceFiles []ServiceFileInfo // contains filtered or unexported fields }
type ServiceField ¶
type TableInfo ¶ added in v1.1.6
type TableInfo struct { Generated bool // whether to generate db model FileName string // generated file name S string // the first letter(lower case)of simple Name (receiver) QueryStructName string // internal query struct name ModelStructName string // origin/model struct name TableName string // table name in db server }
Click to show internal directories.
Click to hide internal directories.