config

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(command string, flagSet *pflag.FlagSet) error

Types

type Config

type Config struct {
	Syntax  string `mapstructure:"syntax"`
	Version string `mapstructure:"version"`

	/*
		===============================command flags start========================================
	*/
	// 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"`
}
var C Config

C global command flags

func (*Config) Wd added in v0.25.0

func (c *Config) Wd() string

type GenConfig

type GenConfig struct {
	Hooks HooksConfig `mapstructure:"hooks"`

	Home             string `mapstructure:"home"`
	Style            string `mapstructure:"style"`
	SplitApiTypesDir bool   `mapstructure:"split-api-types-dir"`

	ChangeLogicTypes bool `mapstructure:"change-logic-types"`
	RpcStylePatch    bool `mapstructure:"rpc-style-patch"`
	RemoveSuffix     bool `mapstructure:"remove-suffix"`
	RegenApiHandler  bool `mapstructure:"regen-api-handler"`

	GitChange          bool   `mapstructure:"git-change"`
	ApiGitChangePath   string `mapstructure:"api-git-change-path"`
	ModelGitChangePath string `mapstructure:"model-git-change-path"`
	ProtoGitChangePath string `mapstructure:"proto-git-change-path"`

	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"`

	Sdk        GenSdkConfig        `mapstructure:"sdk"`
	Swagger    GenSwaggerConfig    `mapstructure:"swagger"`
	Zrpcclient GenZrpcclientConfig `mapstructure:"zrpcclient"`
	Docs       GenDocsConfig       `mapstructure:"docs"`
}

type GenDocsConfig added in v0.23.3

type GenDocsConfig struct {
	Output   string `mapstructure:"output"`
	Format   string `mapstructure:"format"`
	ApiDir   string `mapstructure:"api-dir"`
	ProtoDir string `mapstructure:"proto-dir"`
}

type GenSdkConfig

type GenSdkConfig struct {
	Hooks HooksConfig `mapstructure:"hooks"`

	Scope        string `mapstructure:"scope"`
	ApiDir       string `mapstructure:"api-dir"`
	ProtoDir     string `mapstructure:"proto-dir"`
	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"`
}

type GenSwaggerConfig

type GenSwaggerConfig struct {
	Output   string `mapstructure:"output"`
	ApiDir   string `mapstructure:"api-dir"`
	ProtoDir string `mapstructure:"proto-dir"`
}

type GenZrpcclientConfig

type GenZrpcclientConfig struct {
	Hooks HooksConfig `mapstructure:"hooks"`

	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 HooksConfig struct {
	Before []string `mapstructure:"before"`
	After  []string `mapstructure:"after"`
}

type IvmAddApiConfig

type IvmAddApiConfig struct {
	Name     string   `mapstructure:"name"`
	Group    string   `mapstructure:"group"`
	Handlers []string `mapstructure:"handlers"`
}

type IvmAddConfig

type IvmAddConfig struct {
	Api   IvmAddApiConfig   `mapstructure:"api"`
	Proto IvmAddProtoConfig `mapstructure:"proto"`
}

type IvmAddProtoConfig

type IvmAddProtoConfig struct {
	Methods  []string `mapstructure:"methods"`
	Name     string   `mapstructure:"name"`
	Services []string `mapstructure:"services"`
}

type IvmConfig

type IvmConfig struct {
	// global flags
	Version string `mapstructure:"version"`

	Init IvmInitConfig `mapstructure:"init"`
	Add  IvmAddConfig  `mapstructure:"add"`
}

type IvmInitConfig

type IvmInitConfig struct {
	Style            string `mapstructure:"style"`
	RemoveSuffix     bool   `mapstructure:"remove-suffix"`
	ChangeLogicTypes bool   `mapstructure:"change-logic-types"`
}

type NewConfig

type NewConfig struct {
	Home         string   `mapstructure:"home"`
	Module       string   `mapstructure:"module"`
	SubModule    bool     `mapstructure:"submodule"`
	Output       string   `mapstructure:"output"`
	Remote       string   `mapstructure:"remote"`
	Cache        bool     `mapstructure:"cache"`
	Frame        string   `mapstructure:"frame"`
	Branch       string   `mapstructure:"branch"`
	WithTemplate bool     `mapstructure:"with-template"`
	Style        string   `mapstructure:"style"`
	Features     []string `mapstructure:"features"`
}

type TemplateBuildConfig

type TemplateBuildConfig struct {
	Output     string `mapstructure:"output"`
	WorkingDir string `mapstructure:"working-dir"`
	Name       string `mapstructure:"name"`
}

type TemplateConfig

type TemplateConfig struct {
	Init  TemplateInitConfig  `mapstructure:"init"`
	Build TemplateBuildConfig `mapstructure:"build"`
}

type TemplateInitConfig

type TemplateInitConfig struct {
	Output string `mapstructure:"output"`
	Remote string `mapstructure:"remote"`
	Branch string `mapstructure:"branch"`
}

type UpgradeConfig

type UpgradeConfig struct {
	Channel string `mapstructure:"channel"`
}

Jump to

Keyboard shortcuts

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