cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 13 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-cli 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-cli 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-cli 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-cli 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-cli 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 MysqlCommand = cli.Command{
	Name:        "mysql",
	Usage:       "generate dao code",
	UsageText:   "ginger-cli mysql [sub-command] [option]",
	Description: "generate sql builder code for dao which fork didi/gendry",
	Subcommands: []cli.Command{
		subCommandSchema,
		subCommandDao,
	},
}
View Source
var RepoCommand = cli.Command{
	Name:        "repo",
	Usage:       "generate repo file and function code for mongodb repository",
	UsageText:   "ginger-cli 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