Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MySQLCmd = &cobra.Command{ Use: "mysql", Short: "generete model from mysql datasource and basic CRUD base on GORM", DisableFlagsInUseLine: true, Run: func(cmd *cobra.Command, args []string) { datasource := viper.GetString("datasource") filter := viper.GetString("filter") dir := viper.GetString("dir") pkg := viper.GetString("pkg") gormcomment := viper.GetBool("gormcomment") x := regexp.MustCompile(filter) config := &Config{ Dir: dir, Pkg: pkg, Filter: x, Gormcomment: gormcomment, } err := NewMySQLGenerator(config).Gen(datasource) if err != nil { log.Error("generate error", zap.Error(err)) } }, } )
Functions ¶
This section is empty.
Types ¶
type MySQLGenerator ¶
func NewMySQLGenerator ¶
func NewMySQLGenerator(config *Config) *MySQLGenerator
func (*MySQLGenerator) Gen ¶
func (t *MySQLGenerator) Gen(dsn string) error
Click to show internal directories.
Click to hide internal directories.