Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultOutPath = "./internal/repository/mysql" VersionText = "数据库生成GORM Repository文件" )
Variables ¶
View Source
var CmdCreate = &cobra.Command{ Use: "create [type] [controller-name]", Short: "Create a new ctl/logic/repo", Example: "kun create ctl user", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { }, }
View Source
var CmdCreateAll = &cobra.Command{ Use: "all", Short: "Create a new controller & logic", Example: "kun create all user", Args: cobra.ExactArgs(1), Run: runCreate, }
View Source
var CmdCreateController = &cobra.Command{ Use: "ctl", Short: "Create a new controller", Example: "kun create ctl user", Args: cobra.ExactArgs(1), Run: runCreate, }
View Source
var CmdCreateLogic = &cobra.Command{ Use: "logic", Short: "Create a new logic", Example: "kun create logic user", Args: cobra.ExactArgs(1), Run: runCreate, }
View Source
var CmdCreateRepository = &cobra.Command{ Use: "repo", Short: "Create a new repository", Example: "kun create repo \"name:pwd@tcp(127.0.0.1:3306)/dbname\" [t1,t2|t1|*]", Args: cobra.ExactArgs(2), Run: genRepo, }
Functions ¶
This section is empty.
Types ¶
type CmdParams ¶
type CmdParams struct { DSN string // user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local Tables []string // 输入所需的数据表或将其留空,留空数据库中所有的数据表 OutPath string // 指定输出目录 Prefix string // 表前缀,不为空则model不包含前缀 DBType string // 数据库类型 }
CmdParams is command line parameters
Click to show internal directories.
Click to hide internal directories.