Documentation
¶
Index ¶
- func SetConfig(command string, flagSet *pflag.FlagSet) error
- type Config
- type GenConfig
- type GenCrudConfig
- type GenDocsConfig
- type GenSdkConfig
- type GenSwaggerConfig
- type GenZrpcclientConfig
- type HooksConfig
- type IvmAddApiConfig
- type IvmAddConfig
- type IvmAddProtoConfig
- type IvmConfig
- type IvmInitConfig
- type NewConfig
- type ServerlessConfig
- type ServerlessDeleteConfig
- type TemplateBuildConfig
- type TemplateConfig
- type TemplateInitConfig
- type UpgradeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// global flags
Debug bool `mapstructure:"debug"`
DebugSleepTime int `mapstructure:"debug-sleep-time"`
// new command
New NewConfig `mapstructure:"new"`
// gen command
Gen GenConfig `mapstructure:"gen"`
// ivm command
Ivm IvmConfig `mapstructure:"ivm"`
// template command
Template TemplateConfig `mapstructure:"template"`
// upgrade command
Upgrade UpgradeConfig `mapstructure:"upgrade"`
// serverless command
Serverless ServerlessConfig `mapstructure:"serverless"`
}
var C Config
C global command flags
type GenConfig ¶
type GenConfig struct {
Hooks HooksConfig `mapstructure:"hooks"`
// global flags
Home string `mapstructure:"home"`
Style string `mapstructure:"style"`
// code style flags
ChangeLogicTypes bool `mapstructure:"change-logic-types"`
RpcStylePatch bool `mapstructure:"rpc-style-patch"`
RegenApiHandler bool `mapstructure:"regen-api-handler"`
// git flags
GitChange bool `mapstructure:"git-change"`
// model flags
ModelMysqlStrict bool `mapstructure:"model-mysql-strict"`
ModelMysqlIgnoreColumns []string `mapstructure:"model-mysql-ignore-columns"`
ModelMysqlDDLDatabase string `mapstructure:"model-mysql-ddl-database"`
ModelMysqlDatasource bool `mapstructure:"model-mysql-datasource"`
ModelMysqlDatasourceUrl string `mapstructure:"model-mysql-datasource-url"`
ModelMysqlDatasourceTable []string `mapstructure:"model-mysql-datasource-table"`
ModelMysqlCache bool `mapstructure:"model-mysql-cache"`
ModelMysqlCachePrefix string `mapstructure:"model-mysql-cache-prefix"`
GenMysqlCreateTableDDL bool `mapstructure:"gen-mysql-create-table-ddl"`
// rpc flags
RpcClient bool `mapstructure:"rpc-client"`
// gen code flags
Desc []string `mapstructure:"desc"`
DescIgnore []string `mapstructure:"desc-ignore"`
// other
Route2Code bool
Sdk GenSdkConfig `mapstructure:"sdk"`
Swagger GenSwaggerConfig `mapstructure:"swagger"`
Zrpcclient GenZrpcclientConfig `mapstructure:"zrpcclient"`
Docs GenDocsConfig `mapstructure:"docs"`
Crud GenCrudConfig `mapstructure:"crud"`
}
type GenCrudConfig ¶ added in v0.32.0
type GenCrudConfig struct {
}
type GenDocsConfig ¶ added in v0.23.3
type GenSdkConfig ¶
type GenSdkConfig struct {
Hooks HooksConfig `mapstructure:"hooks"`
Desc []string `mapstructure:"desc"`
DescIgnore []string `mapstructure:"desc-ignore"`
Scope string `mapstructure:"scope"`
WrapResponse bool `mapstructure:"wrap-response"`
Output string `mapstructure:"output"`
Language string `mapstructure:"language"`
GoVersion string `mapstructure:"goVersion"`
GoModule string `mapstructure:"goModule"`
GoPackage string `mapstructure:"goPackage"`
Mono bool `mapstructure:"mono"`
}
type GenSwaggerConfig ¶
type GenZrpcclientConfig ¶
type GenZrpcclientConfig struct {
Hooks HooksConfig `mapstructure:"hooks"`
Desc []string `mapstructure:"desc"`
DescIgnore []string `mapstructure:"desc-ignore"`
PbDir string `mapstructure:"pb-dir"`
ClientDir string `mapstructure:"client-dir"`
Scope string `mapstructure:"scope"`
Output string `mapstructure:"output"`
GoVersion string `mapstructure:"goVersion"`
GoModule string `mapstructure:"goModule"`
GoPackage string `mapstructure:"goPackage"`
}
type HooksConfig ¶ added in v0.23.2
type IvmAddApiConfig ¶
type IvmAddConfig ¶
type IvmAddConfig struct {
Api IvmAddApiConfig `mapstructure:"api"`
Proto IvmAddProtoConfig `mapstructure:"proto"`
}
type IvmAddProtoConfig ¶
type IvmConfig ¶
type IvmConfig struct {
// global flags
Version string `mapstructure:"version"`
Init IvmInitConfig `mapstructure:"init"`
Add IvmAddConfig `mapstructure:"add"`
}
type IvmInitConfig ¶
type NewConfig ¶
type NewConfig struct {
Home string `mapstructure:"home"` // 新建项目使用的模板文件目录
Module string `mapstructure:"module"` // 新建的项目的 go module
Mono bool `mapstructure:"mono"` // 是否是 mono 项目(即在一个mod项目之下, 但该项目本身无 go.mod 文件)
Output string `mapstructure:"output"` // 输出到的目录
Remote string `mapstructure:"remote"` // 远程仓库地址
Cache bool `mapstructure:"cache"` // 当使用远程仓库时是否使用缓存
RemoteAuthUsername string `mapstructure:"remote-auth-username"` // 远程仓库的认证用户名
RemoteAuthPassword string `mapstructure:"remote-auth-password"` // 远程仓库的认证密码
Frame string `mapstructure:"frame"` // 使用 jzero 内置的框架
Branch string `mapstructure:"branch"` // 使用远程模板仓库的某个分支
Local string `mapstructure:"local"` // 使用本地模板与 branch 对应
Features []string `mapstructure:"features"` // 新建项目使用哪些特性, 灵活构建模板
}
type ServerlessConfig ¶ added in v0.28.1
type ServerlessConfig struct {
Home string `mapstructure:"home"` // 使用的模板文件目录
Delete ServerlessDeleteConfig `mapstructure:"delete"`
}
type ServerlessDeleteConfig ¶ added in v0.28.1
type ServerlessDeleteConfig struct {
Plugin []string `mapstructure:"plugin"`
}
type TemplateBuildConfig ¶
type TemplateConfig ¶
type TemplateConfig struct {
Init TemplateInitConfig `mapstructure:"init"`
Build TemplateBuildConfig `mapstructure:"build"`
}
type TemplateInitConfig ¶
type UpgradeConfig ¶
type UpgradeConfig struct {
Channel string `mapstructure:"channel"`
}
Click to show internal directories.
Click to hide internal directories.