Documentation
¶
Overview ¶
使用template模板方式,将Struct对象转换为go文件
Index ¶
Constants ¶
View Source
const ( AppName = "dbcoder" VERSION = "v1.0.0" )
Variables ¶
View Source
var GormTemplete = `func BeforunUpdaet() {
}
func AfterUpdaet() {
}`
Functions ¶
Types ¶
type Field ¶
type Field struct { Name string // 字段名称 Type string // 字段类型 Tag string // 字段标签 Comment string // 字段注释 }
Go文件中的结构体字段
type GenTemplate ¶
type Profile ¶
type Profile struct { AppName string // 应用名称 Version string // 应用版本 Host string // 主机 Port int // 端口,具化默认值 User string // 用户,具化默认值 Auth string // 密码,具化默认值 DbName string // 数据库 Ignores []string // 忽略的数据表 Package string // 包名 Plump bool // 生成增删改查等数据操作代码 Out string // 输出路径 Pile bool // 单文件输出 }
代码生成器概要信息
Click to show internal directories.
Click to hide internal directories.