cmd

package
v0.3.1-0...-35701da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheCommand = cli.Command{
	Name:        "cache",
	Usage:       "generate cache function code",
	UsageText:   "ginger-gen cache [option]",
	Description: "generate cache function code ",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "root, r", Value: "github.com/gofuncchan/ginger", Usage: "root package name"},
		cli.StringFlag{Name: "module, m", Usage: "cache module name"},
		cli.StringSliceFlag{Name: "func, f", Usage: "cache function name,one or more"},
	},
	Action: cacheCommandAction,
}

创建redis cache方法

View Source
var ConfigCommand = cli.Command{
	Name:        "config",
	Usage:       "generate config parse code for yaml file ",
	UsageText:   "ginger-gen config [sub-command] [option]",
	Description: "generate config init code for yaml config file",
	Subcommands: []cli.Command{
		subCommandParse,
	},
}

根据config 配置文件生成配置参数解析代码

View Source
var HandlerCommand = cli.Command{
	Name:        "handler",
	Usage:       "generate handler function code",
	UsageText:   "ginger-gen handler [option]",
	Description: "generate handler function code and request params validator struct",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "root, r", Value: "github.com/gofuncchan/ginger", Usage: "root package name"},
		cli.StringFlag{Name: "module, m", Usage: "module name"},
		cli.StringSliceFlag{Name: "func, f", Usage: "handler function name,one or more"},
	},
	Action: handlerCommandAction,
}

创建handlers方法

View Source
var InitCommand = cli.Command{
	Name:        "init",
	Usage:       "ginger app init.",
	UsageText:   "ginger-gen init [--name|-n] [project_name]",
	Description: "The init command create a new gin application in current directory,this command will generate some necessary folders and files,which make up project scaffold.",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "name, n", Usage: "project name"},
		cli.BoolFlag{Name: "g", Usage: "git init"},
	},
	Action: initCommandFunc,
}
View Source
var ModelCommand = cli.Command{
	Name:        "model",
	Usage:       "generate biz logic model function code for mysql builder",
	UsageText:   "ginger-gen model [option]",
	Description: "generate biz logic model function code for mysql builder",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "root, r", Value: "github.com/gofuncchan/ginger", Usage: "root package name"},
		cli.StringFlag{Name: "module, m", Usage: "module name"},
		cli.StringSliceFlag{Name: "func, f", Usage: "model function name,one or more"},
	},
	Action: modelCommandAction,
}

创建mysql model方法

View Source
var ModuleCommand = cli.Command{
	Name:        "module",
	Usage:       "generate CURD actions for a module",
	UsageText:   "ginger-gen module [option]",
	Description: "generate CURD actions for a module",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "root, r", Value: "github.com/gofuncchan/ginger", Usage: "root package name"},
		cli.StringFlag{Name: "host, H", Value: "localhost"},
		cli.IntFlag{Name: "port, P", Value: 3306},
		cli.StringFlag{Name: "user, u", Value: "root"},
		cli.StringFlag{Name: "password, p", Value: "123456"},
		cli.StringFlag{Name: "database, d", Required: true},
		cli.StringFlag{Name: "table, t", Required: true},
	},
	Action: moduleCommandAction,
}

生成curd模块

View Source
var MysqlCommand = cli.Command{
	Name:        "schema",
	Usage:       "generate mysql table schema to go struct",
	UsageText:   "generate mysql table schema to go struct",
	Description: "generate sql builder code for dao which fork didi/gendry",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "host, H", Value: "localhost"},
		cli.IntFlag{Name: "port, P", Value: 3306},
		cli.StringFlag{Name: "user, u", Value: "root"},
		cli.StringFlag{Name: "password, p", Value: "123456"},
		cli.StringFlag{Name: "database, d", Required: true},
		cli.StringFlag{Name: "table, t", Required: true},
	},
	Action: commandSchemaAction,
}
View Source
var RepoCommand = cli.Command{
	Name:        "repo",
	Usage:       "generate repo file and function code for mongodb repository",
	UsageText:   "ginger-gen repo [option]",
	Description: "generate repo file and function code for mongodb repository",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "root, r", Value: "github.com/gofuncchan/ginger", Usage: "root package name"},
		cli.StringFlag{Name: "module, m", Usage: "repo file name"},
		cli.StringSliceFlag{Name: "func, f", Usage: "repo function name,one or more"},
	},
	Action: repoCommandAction,
}

创建mongo repo方法

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL