state

package
v0.0.0-...-f07db7a Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	I18nTagCli                                   = `cli`
	I18nTagCliCompletion                         = `cli.completion`
	I18nTagCliCompletionFlags                    = `cli.completion.flags`
	I18nTagCliCompletionFlagsNoDescriptions      = `cli.completion.flags.no-descriptions`
	I18nTagCliCompletionLong                     = `cli.completion.long`
	I18nTagCliCompletionShort                    = `cli.completion.short`
	I18nTagCliCompletionSubcommand               = `cli.completion.subcommand`
	I18nTagCliCompletionSubcommandShort          = `cli.completion.subcommand.short`
	I18nTagCliFlags                              = `cli.flags`
	I18nTagCliFlagsDebug                         = `cli.flags.debug`
	I18nTagCliGen                                = `cli.gen`
	I18nTagCliGenAddRpc                          = `cli.gen.add-rpc`
	I18nTagCliGenAddRpcFlags                     = `cli.gen.add-rpc.flags`
	I18nTagCliGenAddRpcFlagsAction               = `cli.gen.add-rpc.flags.action`
	I18nTagCliGenAddRpcFlagsDefaultRole          = `cli.gen.add-rpc.flags.default-role`
	I18nTagCliGenAddRpcFlagsGenTo                = `cli.gen.add-rpc.flags.gen-to`
	I18nTagCliGenAddRpcFlagsListOption           = `cli.gen.add-rpc.flags.list-option`
	I18nTagCliGenAddRpcFlagsModel                = `cli.gen.add-rpc.flags.model`
	I18nTagCliGenAddRpcLong                      = `cli.gen.add-rpc.long`
	I18nTagCliGenAddRpcShort                     = `cli.gen.add-rpc.short`
	I18nTagCliGenAll                             = `cli.gen.all`
	I18nTagCliGenAllLong                         = `cli.gen.all.long`
	I18nTagCliGenAllShort                        = `cli.gen.all.short`
	I18nTagCliGenCache                           = `cli.gen.cache`
	I18nTagCliGenCacheLong                       = `cli.gen.cache.long`
	I18nTagCliGenCacheShort                      = `cli.gen.cache.short`
	I18nTagCliGenCmd                             = `cli.gen.cmd`
	I18nTagCliGenCmdLong                         = `cli.gen.cmd.long`
	I18nTagCliGenCmdShort                        = `cli.gen.cmd.short`
	I18nTagCliGenConf                            = `cli.gen.conf`
	I18nTagCliGenConfLong                        = `cli.gen.conf.long`
	I18nTagCliGenConfShort                       = `cli.gen.conf.short`
	I18nTagCliGenDockerignore                    = `cli.gen.dockerignore`
	I18nTagCliGenDockerignoreLong                = `cli.gen.dockerignore.long`
	I18nTagCliGenDockerignoreShort               = `cli.gen.dockerignore.short`
	I18nTagCliGenEditorconfig                    = `cli.gen.editorconfig`
	I18nTagCliGenEditorconfigLong                = `cli.gen.editorconfig.long`
	I18nTagCliGenEditorconfigShort               = `cli.gen.editorconfig.short`
	I18nTagCliGenFlags                           = `cli.gen.flags`
	I18nTagCliGenFlagsAddProtoFiles              = `cli.gen.flags.add-proto-files`
	I18nTagCliGenFlagsGoModulePrefix             = `cli.gen.flags.go-module-prefix`
	I18nTagCliGenFlagsInput                      = `cli.gen.flags.input`
	I18nTagCliGenFlagsOutputPath                 = `cli.gen.flags.output-path`
	I18nTagCliGenFlagsOverwrite                  = `cli.gen.flags.overwrite`
	I18nTagCliGenFlagsProtoFiles                 = `cli.gen.flags.proto-files`
	I18nTagCliGenFlagsProtoc                     = `cli.gen.flags.protoc`
	I18nTagCliGenFlagsProtocGenGo                = `cli.gen.flags.protoc-gen-go`
	I18nTagCliGenFlagsTablesEnableFieldCreatedAt = `cli.gen.flags.tables-enable_field_created_at`
	I18nTagCliGenFlagsTablesEnableFieldDeletedAt = `cli.gen.flags.tables-enable_field_deleted_at`
	I18nTagCliGenFlagsTablesEnableFieldId        = `cli.gen.flags.tables-enable_field_id`
	I18nTagCliGenFlagsTablesEnableFieldUpdatedAt = `cli.gen.flags.tables-enable_field_updated_at`
	I18nTagCliGenFlagsTablesEnableGormTagColumn  = `cli.gen.flags.tables-enable_gorm_tag_column`
	I18nTagCliGenGitignote                       = `cli.gen.gitignote`
	I18nTagCliGenGitignoteLong                   = `cli.gen.gitignote.long`
	I18nTagCliGenGitignoteShort                  = `cli.gen.gitignote.short`
	I18nTagCliGenGolangLint                      = `cli.gen.golang-lint`
	I18nTagCliGenGolangLintLong                  = `cli.gen.golang-lint.long`
	I18nTagCliGenGolangLintShort                 = `cli.gen.golang-lint.short`
	I18nTagCliGenGoreleaser                      = `cli.gen.goreleaser`
	I18nTagCliGenGoreleaserLong                  = `cli.gen.goreleaser.long`
	I18nTagCliGenGoreleaserShort                 = `cli.gen.goreleaser.short`
	I18nTagCliGenImpl                            = `cli.gen.impl`
	I18nTagCliGenImplFlags                       = `cli.gen.impl.flags`
	I18nTagCliGenImplFlagsTemplateImplPath       = `cli.gen.impl.flags.template-impl-path`
	I18nTagCliGenImplFlagsTemplateImplRoute      = `cli.gen.impl.flags.template-impl-route`
	I18nTagCliGenImplLong                        = `cli.gen.impl.long`
	I18nTagCliGenImplShort                       = `cli.gen.impl.short`
	I18nTagCliGenLong                            = `cli.gen.long`
	I18nTagCliGenMakefile                        = `cli.gen.makefile`
	I18nTagCliGenMakefileLong                    = `cli.gen.makefile.long`
	I18nTagCliGenMakefileShort                   = `cli.gen.makefile.short`
	I18nTagCliGenMod                             = `cli.gen.mod`
	I18nTagCliGenModLong                         = `cli.gen.mod.long`
	I18nTagCliGenModShort                        = `cli.gen.mod.short`
	I18nTagCliGenPb                              = `cli.gen.pb`
	I18nTagCliGenPbLong                          = `cli.gen.pb.long`
	I18nTagCliGenPbShort                         = `cli.gen.pb.short`
	I18nTagCliGenShort                           = `cli.gen.short`
	I18nTagCliGenState                           = `cli.gen.state`
	I18nTagCliGenStateConf                       = `cli.gen.state.conf`
	I18nTagCliGenStateConfLong                   = `cli.gen.state.conf.long`
	I18nTagCliGenStateConfShort                  = `cli.gen.state.conf.short`
	I18nTagCliGenStateFlags                      = `cli.gen.state.flags`
	I18nTagCliGenStateFlagsCache                 = `cli.gen.state.flags.cache`
	I18nTagCliGenStateFlagsConfig                = `cli.gen.state.flags.config`
	I18nTagCliGenStateFlagsI18n                  = `cli.gen.state.flags.i18n`
	I18nTagCliGenStateFlagsTable                 = `cli.gen.state.flags.table`
	I18nTagCliGenStateI18n                       = `cli.gen.state.i18n`
	I18nTagCliGenStateI18nLong                   = `cli.gen.state.i18n.long`
	I18nTagCliGenStateI18nShort                  = `cli.gen.state.i18n.short`
	I18nTagCliGenStateLong                       = `cli.gen.state.long`
	I18nTagCliGenStateShort                      = `cli.gen.state.short`
	I18nTagCliGenStateTable                      = `cli.gen.state.table`
	I18nTagCliGenStateTableLong                  = `cli.gen.state.table.long`
	I18nTagCliGenStateTableShort                 = `cli.gen.state.table.short`
	I18nTagCliGenTable                           = `cli.gen.table`
	I18nTagCliGenTableFlags                      = `cli.gen.table.flags`
	I18nTagCliGenTableFlagsTemplateStateTable    = `cli.gen.table.flags.template-state-table`
	I18nTagCliGenTableLong                       = `cli.gen.table.long`
	I18nTagCliGenTableShort                      = `cli.gen.table.short`
	I18nTagCliGroup                              = `cli.group`
	I18nTagCliGroupGen                           = `cli.group.gen`
	I18nTagCliHelp                               = `cli.help`
	I18nTagCliHelpAdditionalCommands             = `cli.help.additional_commands`
	I18nTagCliHelpAliases                        = `cli.help.aliases`
	I18nTagCliHelpAvailableCommands              = `cli.help.available_commands`
	I18nTagCliHelpCommand                        = `cli.help.command`
	I18nTagCliHelpFlags                          = `cli.help.flags`
	I18nTagCliHelpGetInfo                        = `cli.help.get_info`
	I18nTagCliHelpGlobalFlags                    = `cli.help.global_flags`
	I18nTagCliHelpLong                           = `cli.help.long`
	I18nTagCliHelpShort                          = `cli.help.short`
	I18nTagCliHelpUsage                          = `cli.help.usage`
	I18nTagCliHelpUse                            = `cli.help.use`
	I18nTagCliI18n                               = `cli.i18n`
	I18nTagCliI18nLong                           = `cli.i18n.long`
	I18nTagCliI18nShort                          = `cli.i18n.short`
	I18nTagCliI18nSupport                        = `cli.i18n.support`
	I18nTagCliI18nSupportFlags                   = `cli.i18n.support.flags`
	I18nTagCliI18nSupportFlagsLanguage           = `cli.i18n.support.flags.language`
	I18nTagCliI18nSupportLong                    = `cli.i18n.support.long`
	I18nTagCliI18nSupportShort                   = `cli.i18n.support.short`
	I18nTagCliI18nTran                           = `cli.i18n.tran`
	I18nTagCliI18nTranFlags                      = `cli.i18n.tran.flags`
	I18nTagCliI18nTranFlagsAllLanguage           = `cli.i18n.tran.flags.all-language`
	I18nTagCliI18nTranFlagsForce                 = `cli.i18n.tran.flags.force`
	I18nTagCliI18nTranFlagsForceKeyPrefix        = `cli.i18n.tran.flags.force-key-prefix`
	I18nTagCliI18nTranFlagsGenerateConst         = `cli.i18n.tran.flags.generate-const`
	I18nTagCliI18nTranFlagsGenerateField         = `cli.i18n.tran.flags.generate-field`
	I18nTagCliI18nTranFlagsLanguages             = `cli.i18n.tran.flags.languages`
	I18nTagCliI18nTranFlagsSrcFile               = `cli.i18n.tran.flags.src-file`
	I18nTagCliI18nTranFlagsSrcLanguage           = `cli.i18n.tran.flags.src-language`
	I18nTagCliI18nTranFlagsTranslator            = `cli.i18n.tran.flags.translator`
	I18nTagCliI18nTranFlagsTranslatorGoogleFree  = `cli.i18n.tran.flags.translator.google-free`
	I18nTagCliI18nTranFlagsTranslatorUsage       = `cli.i18n.tran.flags.translator.usage`
	I18nTagCliI18nTranLong                       = `cli.i18n.tran.long`
	I18nTagCliI18nTranShort                      = `cli.i18n.tran.short`
	I18nTagCliLong                               = `cli.long`
	I18nTagCliShort                              = `cli.short`
	I18nTagCliSync                               = `cli.sync`
	I18nTagCliSyncFlags                          = `cli.sync.flags`
	I18nTagCliSyncFlagsPassword                  = `cli.sync.flags.password`
	I18nTagCliSyncFlagsTemplatePath              = `cli.sync.flags.template-path`
	I18nTagCliSyncFlagsUsername                  = `cli.sync.flags.username`
	I18nTagCliSyncLong                           = `cli.sync.long`
	I18nTagCliSyncShort                          = `cli.sync.short`
	I18nTagCliUpMod                              = `cli.up-mod`
	I18nTagCliUpModFlags                         = `cli.up-mod.flags`
	I18nTagCliUpModFlagsGoproxy                  = `cli.up-mod.flags.goproxy`
	I18nTagCliUpModLong                          = `cli.up-mod.long`
	I18nTagCliUpModShort                         = `cli.up-mod.short`
	I18nTagLang                                  = `lang`
	I18nTagLangAf                                = `lang.af`
	I18nTagLangAk                                = `lang.ak`
	I18nTagLangAm                                = `lang.am`
	I18nTagLangAr                                = `lang.ar`
	I18nTagLangAs                                = `lang.as`
	I18nTagLangAy                                = `lang.ay`
	I18nTagLangAz                                = `lang.az`
	I18nTagLangBe                                = `lang.be`
	I18nTagLangBg                                = `lang.bg`
	I18nTagLangBho                               = `lang.bho`
	I18nTagLangBm                                = `lang.bm`
	I18nTagLangBn                                = `lang.bn`
	I18nTagLangBs                                = `lang.bs`
	I18nTagLangCa                                = `lang.ca`
	I18nTagLangCeb                               = `lang.ceb`
	I18nTagLangCkb                               = `lang.ckb`
	I18nTagLangCo                                = `lang.co`
	I18nTagLangCs                                = `lang.cs`
	I18nTagLangCy                                = `lang.cy`
	I18nTagLangDa                                = `lang.da`
	I18nTagLangDe                                = `lang.de`
	I18nTagLangDoi                               = `lang.doi`
	I18nTagLangDv                                = `lang.dv`
	I18nTagLangEe                                = `lang.ee`
	I18nTagLangEl                                = `lang.el`
	I18nTagLangEn                                = `lang.en`
	I18nTagLangEo                                = `lang.eo`
	I18nTagLangEs                                = `lang.es`
	I18nTagLangEt                                = `lang.et`
	I18nTagLangEu                                = `lang.eu`
	I18nTagLangFa                                = `lang.fa`
	I18nTagLangFi                                = `lang.fi`
	I18nTagLangFil                               = `lang.fil`
	I18nTagLangFr                                = `lang.fr`
	I18nTagLangFy                                = `lang.fy`
	I18nTagLangGa                                = `lang.ga`
	I18nTagLangGd                                = `lang.gd`
	I18nTagLangGl                                = `lang.gl`
	I18nTagLangGn                                = `lang.gn`
	I18nTagLangGom                               = `lang.gom`
	I18nTagLangGu                                = `lang.gu`
	I18nTagLangHa                                = `lang.ha`
	I18nTagLangHaw                               = `lang.haw`
	I18nTagLangHe                                = `lang.he`
	I18nTagLangHi                                = `lang.hi`
	I18nTagLangHmn                               = `lang.hmn`
	I18nTagLangHr                                = `lang.hr`
	I18nTagLangHt                                = `lang.ht`
	I18nTagLangHu                                = `lang.hu`
	I18nTagLangHy                                = `lang.hy`
	I18nTagLangId                                = `lang.id`
	I18nTagLangIg                                = `lang.ig`
	I18nTagLangIlo                               = `lang.ilo`
	I18nTagLangIs                                = `lang.is`
	I18nTagLangIt                                = `lang.it`
	I18nTagLangIw                                = `lang.iw`
	I18nTagLangJa                                = `lang.ja`
	I18nTagLangJv                                = `lang.jv`
	I18nTagLangJw                                = `lang.jw`
	I18nTagLangKa                                = `lang.ka`
	I18nTagLangKk                                = `lang.kk`
	I18nTagLangKm                                = `lang.km`
	I18nTagLangKn                                = `lang.kn`
	I18nTagLangKo                                = `lang.ko`
	I18nTagLangKri                               = `lang.kri`
	I18nTagLangKu                                = `lang.ku`
	I18nTagLangKy                                = `lang.ky`
	I18nTagLangLa                                = `lang.la`
	I18nTagLangLb                                = `lang.lb`
	I18nTagLangLg                                = `lang.lg`
	I18nTagLangLn                                = `lang.ln`
	I18nTagLangLo                                = `lang.lo`
	I18nTagLangLt                                = `lang.lt`
	I18nTagLangLus                               = `lang.lus`
	I18nTagLangLv                                = `lang.lv`
	I18nTagLangMai                               = `lang.mai`
	I18nTagLangMg                                = `lang.mg`
	I18nTagLangMi                                = `lang.mi`
	I18nTagLangMk                                = `lang.mk`
	I18nTagLangMl                                = `lang.ml`
	I18nTagLangMn                                = `lang.mn`
	I18nTagLangMniMtei                           = `lang.mni-mtei`
	I18nTagLangMr                                = `lang.mr`
	I18nTagLangMs                                = `lang.ms`
	I18nTagLangMt                                = `lang.mt`
	I18nTagLangMy                                = `lang.my`
	I18nTagLangNe                                = `lang.ne`
	I18nTagLangNl                                = `lang.nl`
	I18nTagLangNo                                = `lang.no`
	I18nTagLangNso                               = `lang.nso`
	I18nTagLangNy                                = `lang.ny`
	I18nTagLangOm                                = `lang.om`
	I18nTagLangOr                                = `lang.or`
	I18nTagLangPa                                = `lang.pa`
	I18nTagLangPl                                = `lang.pl`
	I18nTagLangPs                                = `lang.ps`
	I18nTagLangPt                                = `lang.pt`
	I18nTagLangPtBr                              = `lang.pt-br`
	I18nTagLangQu                                = `lang.qu`
	I18nTagLangRo                                = `lang.ro`
	I18nTagLangRu                                = `lang.ru`
	I18nTagLangRw                                = `lang.rw`
	I18nTagLangSa                                = `lang.sa`
	I18nTagLangSd                                = `lang.sd`
	I18nTagLangSi                                = `lang.si`
	I18nTagLangSk                                = `lang.sk`
	I18nTagLangSl                                = `lang.sl`
	I18nTagLangSm                                = `lang.sm`
	I18nTagLangSn                                = `lang.sn`
	I18nTagLangSo                                = `lang.so`
	I18nTagLangSq                                = `lang.sq`
	I18nTagLangSr                                = `lang.sr`
	I18nTagLangSt                                = `lang.st`
	I18nTagLangSu                                = `lang.su`
	I18nTagLangSv                                = `lang.sv`
	I18nTagLangSw                                = `lang.sw`
	I18nTagLangTa                                = `lang.ta`
	I18nTagLangTe                                = `lang.te`
	I18nTagLangTg                                = `lang.tg`
	I18nTagLangTh                                = `lang.th`
	I18nTagLangTi                                = `lang.ti`
	I18nTagLangTk                                = `lang.tk`
	I18nTagLangTl                                = `lang.tl`
	I18nTagLangTr                                = `lang.tr`
	I18nTagLangTs                                = `lang.ts`
	I18nTagLangTt                                = `lang.tt`
	I18nTagLangUg                                = `lang.ug`
	I18nTagLangUk                                = `lang.uk`
	I18nTagLangUr                                = `lang.ur`
	I18nTagLangUz                                = `lang.uz`
	I18nTagLangVi                                = `lang.vi`
	I18nTagLangXh                                = `lang.xh`
	I18nTagLangYi                                = `lang.yi`
	I18nTagLangYo                                = `lang.yo`
	I18nTagLangZh                                = `lang.zh`
	I18nTagLangZhChs                             = `lang.zh-chs`
	I18nTagLangZhCht                             = `lang.zh-cht`
	I18nTagLangZhCn                              = `lang.zh-cn`
	I18nTagLangZhHk                              = `lang.zh-hk`
	I18nTagLangZhMo                              = `lang.zh-mo`
	I18nTagLangZhSg                              = `lang.zh-sg`
	I18nTagLangZhTw                              = `lang.zh-tw`
	I18nTagLangZu                                = `lang.zu`
)

Variables

View Source
var Config = new(Cfg)
View Source
var (
	I18n = i18n.DefaultI18n
)
View Source
var LazyConfig = new(CfgLazyConfig)
View Source
var SupportedExt = map[string]Unmarshaler{
	"json": func(reader io.Reader, v interface{}) error {
		return json.NewDecoder(reader).Decode(v)
	},
	"toml": func(reader io.Reader, v interface{}) error {
		return toml.NewDecoder(reader).Decode(v)
	},
	"yaml": func(reader io.Reader, v interface{}) error {
		return yaml.NewDecoder(reader).Decode(v)
	},
	"yml": func(reader io.Reader, v interface{}) error {
		return yaml.NewDecoder(reader).Decode(v)
	},
}

Functions

func Load

func Load() (err error)

func LoadConfig

func LoadConfig() error

func LoadI18n

func LoadI18n() (err error)

func LoadLazeConfig

func LoadLazeConfig(path string) error

func Localize

func Localize(key string, args ...interface{}) string

func LocalizeWithLanguage

func LocalizeWithLanguage(lang string, key string, args ...interface{}) string

func TryFindConfigPath

func TryFindConfigPath(baseDir string) string

Types

type Cfg

type Cfg struct {
	Sync *CfgSync `json:"sync,omitempty" yaml:"sync,omitempty" toml:"sync,omitempty"`

	ProtocPath     string `json:"protoc-path,omitempty" yaml:"protoc-path,omitempty" toml:"protoc-path,omitempty"`
	ProtoGenGoPath string `json:"protogen-go-path,omitempty" yaml:"protogen-go-path,omitempty" toml:"protogen-go-path,omitempty"`

	ProtoFiles []string `json:"proto-files,omitempty" yaml:"proto-files,omitempty" toml:"proto-files,omitempty"`

	GoModulePrefix string `json:"go-module-prefix,omitempty" yaml:"go-module-prefix,omitempty" toml:"go-module-prefix,omitempty"`

	OutputPath string `json:"output-path,omitempty" yaml:"output-path,omitempty" toml:"output-path,omitempty"`

	Language string `json:"language,omitempty" yaml:"language,omitempty" toml:"language,omitempty"`

	I18n *CfgI18n `json:"i18n,omitempty" yaml:"i18n,omitempty" toml:"i18n,omitempty"`

	Style *CfgStyle `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`

	Template *CfgTemplate `json:"template,omitempty" yaml:"template,omitempty" toml:"template,omitempty"`

	// 对于原始数据,key 为 tag 名。value.key 为字段名,value.value 为 tag 内容
	// 例如: {"gorm": {"id": "column:id;primaryKey;autoIncrement;not null"}}
	// 从初始化后整理为,key 为字段名,value.key 为 tag 名,value.value 为 tag 内容
	// 例如: {"id": {"gorm": "column:id;primaryKey;autoIncrement;not null"}}
	DefaultTag map[string]map[string]string `json:"default-tag,omitempty" yaml:"default-tag,omitempty" toml:"default-tag,omitempty"`

	Tables *CfgTables `json:"tables,omitempty" yaml:"tables,omitempty" toml:"tables,omitempty"`

	GoMod *CfgGoMod `json:"go-mod,omitempty" yaml:"go-mod,omitempty" toml:"go-mod,omitempty"`

	State *CfgState `json:"state,omitempty" yaml:"state,omitempty" toml:"state,omitempty"`

	Overwrite bool `json:"-" yaml:"-" toml:"-"`
}

type CfgGoMod

type CfgGoMod struct {
	Goproxy  string `json:"goproxy,omitempty" yaml:"goproxy,omitempty" toml:"goproxy,omitempty"`
	Increase bool   `json:"increase,omitempty" yaml:"increase,omitempty" toml:"increase,omitempty"`
}

type CfgI18n

type CfgI18n struct {
	GenerateConst bool `json:"generate-const,omitempty" yaml:"generate-const,omitempty" toml:"generate-const,omitempty"`
	GenerateField bool `json:"generate-field,omitempty" yaml:"generate-field,omitempty" toml:"generate-field,omitempty"`

	Languages    []string `json:"languages,omitempty" yaml:"languages,omitempty" toml:"languages,omitempty"`
	AllLanguages bool     `json:"all-languages,omitempty" yaml:"all-languages,omitempty" toml:"all-languages,omitempty"`

	Translator string `json:"translator,omitempty" yaml:"translator,omitempty" toml:"translator,omitempty"`
}

type CfgImpl

type CfgImpl struct {
	Action map[string]string `json:"action,omitempty" yaml:"action,omitempty" toml:"action,omitempty"`

	Impl       string `json:"impl,omitempty" yaml:"impl,omitempty" toml:"impl,omitempty"`
	Path       string `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"`
	Route      string `json:"route,omitempty" yaml:"route,omitempty" toml:"route,omitempty"`
	Client     string `json:"client,omitempty" yaml:"client,omitempty" toml:"client,omitempty"`
	ClientCall string `json:"client_call,omitempty" yaml:"client_call,omitempty" toml:"client_call,omitempty"`
}

type CfgLazyConfig

type CfgLazyConfig struct {
	GoMod *CfgLazyGoMod `json:"go-mod,omitempty" yaml:"go-mod,omitempty" toml:"go-mod,omitempty"`

	Gen *CfgLazyGen `json:"gen,omitempty" yaml:"gen,omitempty" toml:"gen,omitempty"`
}

func (*CfgLazyConfig) Apply

func (c *CfgLazyConfig) Apply()

type CfgLazyGen

type CfgLazyGen struct {
	Config *bool `json:"config,omitempty" yaml:"config,omitempty" toml:"config,omitempty"`
	Table  *bool `json:"table,omitempty" yaml:"table,omitempty" toml:"table,omitempty"`
	Cache  *bool `json:"cache,omitempty" yaml:"cache,omitempty" toml:"cache,omitempty"`
	I18n   *bool `json:"i18n,omitempty" yaml:"i18n,omitempty" toml:"i18n,omitempty"`
}

type CfgLazyGoMod

type CfgLazyGoMod struct {
	Goproxy         string            `json:"goproxy,omitempty" yaml:"goproxy,omitempty" toml:"goproxy,omitempty"`
	IncludeRepo     []string          `json:"include-repo,omitempty" yaml:"include-repo,omitempty" toml:"include-repo,omitempty"`
	Branch          map[string]string `json:"branch,omitempty" yaml:"branch,omitempty" toml:"branch,omitempty"`
	Tag             map[string]string `json:"tag,omitempty" yaml:"tag,omitempty" toml:"tag,omitempty"`
	ExcludeBranches []string          `json:"exclude-branches,omitempty" yaml:"exclude-branches,omitempty" toml:"exclude-branches,omitempty"`
}

type CfgProto

type CfgProto struct {
	Action map[string]*CfgProtoAction `json:"action,omitempty" yaml:"action,omitempty" toml:"action,omitempty"`

	Rpc string `json:"rpc,omitempty" yaml:"rpc,omitempty" toml:"rpc,omitempty"`
}

type CfgProtoAction

type CfgProtoAction struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
	Req  string `json:"req,omitempty" yaml:"req,omitempty" toml:"req,omitempty"`
	Resp string `json:"resp,omitempty" yaml:"resp,omitempty" toml:"resp,omitempty"`
}

type CfgState

type CfgState struct {
	Config bool `json:"config,omitempty" yaml:"config,omitempty" toml:"config,omitempty"`
	Table  bool `json:"table,omitempty" yaml:"table,omitempty" toml:"table,omitempty"`
	Cache  bool `json:"cache,omitempty" yaml:"cache,omitempty" toml:"cache,omitempty"`
	I18n   bool `json:"i18n,omitempty" yaml:"i18n,omitempty" toml:"i18n,omitempty"`
}

type CfgStyle

type CfgStyle struct {
	Path CfgStyleName `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"`
}

type CfgStyleName

type CfgStyleName string
const (
	// 使用 rpc name
	CfgStyleNameDefault CfgStyleName = ""
	// 蛇形 rpc_name
	CfgStyleNameSnake CfgStyleName = "snake"
	// (大)驼峰 RpcName
	CfgStyleNamePascal CfgStyleName = "pascal"
	// 小驼峰 rpcName
	CfgStyleNameCamel CfgStyleName = "camel"
	// 中划线 rpc-name
	CfgStyleNameKebab CfgStyleName = "kebab"

	// 斜杠  /add/user/record
	CfgStyleNameSlash CfgStyleName = "slash"
	// 斜杠-行为模型风格-蛇形 /add/user_record
	CfgStyleNameSlashSnake CfgStyleName = "slash-snake"
	// 斜杠-行为模型风格-大驼峰 /add/UserRecord
	CfgStyleNameSlashPascal CfgStyleName = "slash-pascal"
	// 斜杠-行为模型风格-小驼峰 /add/userRecord
	CfgStyleNameSlashCamel CfgStyleName = "slash-camel"
	// 斜杠-行为模型风格-中划线 /add/user-record
	CfgStyleNameSlashKebab CfgStyleName = "slash-kebab"

	// 斜杠-反转 /record/user/add/
	CfgStyleNameSlashReverse CfgStyleName = "slash-reverse"
	// 斜杠-反转-行为模型风格-蛇形 /user_record/add
	CfgStyleNameSlashReverseSnake CfgStyleName = "slash-reverse-snake"
	// 斜杠-反转-行为模型风格-大驼峰 /UserRecord/add
	CfgStyleNameSlashReversePascal CfgStyleName = "slash-reverse-pascal"
	// 斜杠-反转-行为模型风格-小驼峰 /userRecord/add
	CfgStyleNameSlashReverseCamel CfgStyleName = "slash-reverse-camel"
	// 斜杠-反转-行为模型风格-中划线 /user-record/add
	CfgStyleNameSlashReverseKebab CfgStyleName = "slash-reverse-kebab"

	// 点  add.user.record
	CfgStyleNameDot CfgStyleName = "dot"
	// 点-行为模型风格-蛇形 add.user_record
	CfgStyleNameDotSnake CfgStyleName = "dot-snake"
	// 点-行为模型风格-大驼峰 add.UserRecord
	CfgStyleNameDotPascal CfgStyleName = "dot-pascal"
	// 点-行为模型风格-小驼峰 add.userRecord
	CfgStyleNameDotCamel CfgStyleName = "dot-camel"
	// 点-行为模型风格-中划线 add.user-record
	CfgStyleNameDotKebab CfgStyleName = "dot-kebab"

	// 点-反转
	CfgStyleNameDotReverse CfgStyleName = "dot-reverse"
	// 点-反转-行为模型风格-蛇形 user_record.add
	CfgStyleNameDotReverseSnake CfgStyleName = "dot-reverse-snake"
	// 点-反转-行为模型风格-大驼峰 UserRecord.add
	CfgStyleNameDotReversePascal CfgStyleName = "dot-reverse-pascal"
	// 点-反转-行为模型风格-小驼峰 userRecord.add
	CfgStyleNameDotReverseCamel CfgStyleName = "dot-reverse-camel"
	// 点-反转-行为模型风格-中划线 user-record.add
	CfgStyleNameDotReverseKebab CfgStyleName = "dot-reverse-kebab"
)

func (*CfgStyleName) MarshalJSON

func (p *CfgStyleName) MarshalJSON() ([]byte, error)

func (*CfgStyleName) MarshalTOML

func (p *CfgStyleName) MarshalTOML() ([]byte, error)

func (*CfgStyleName) MarshalYAML

func (p *CfgStyleName) MarshalYAML() (interface{}, error)

func (CfgStyleName) String

func (p CfgStyleName) String() string

func (*CfgStyleName) UnmarshalJSON

func (p *CfgStyleName) UnmarshalJSON(data []byte) error

func (*CfgStyleName) UnmarshalTOML

func (p *CfgStyleName) UnmarshalTOML(data []byte) error

func (*CfgStyleName) UnmarshalYAML

func (p *CfgStyleName) UnmarshalYAML(unmarshal func(any) error) error

type CfgSync

type CfgSync struct {
	Remote  string            `json:"remote,omitempty" yaml:"remote,omitempty" toml:"remote,omitempty"`
	Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty" toml:"headers,omitempty"`

	CacheTemplatePath string `json:"cache-template-path,omitempty" yaml:"cache-template-path,omitempty" toml:"cache-template-path,omitempty"`
}

type CfgTables

type CfgTables struct {
	Disable bool `json:"disable,omitempty" yaml:"disable,omitempty" toml:"disable,omitempty"`

	// 是否禁用自动添加 id 字段相关的内容
	DisableFieldId bool `json:"disable-field-id,omitempty" yaml:"disable-field-id,omitempty" tom:"disable-field-id,omitempty"`
	// 是否禁用自动添加 created-at 字段相关的内容
	DisableFieldCreatedAt bool `json:"disable-field-created-at,omitempty" yaml:"disable-field-created-at,omitempty" toml:"disable-field-created-at,omitempty"`
	// 是否禁用自动添加 updated-at 字段相关的内容
	DisableFieldUpdatedAt bool `json:"disable-field-updated-at,omitempty" yaml:"disable-field-updated-at,omitempty" toml:"disable-field-updated-at,omitempty"`
	// 是否禁用自动添加 deleted-at 字段相关的内容
	DisableFieldDeletedAt bool `json:"disable-field-deleted-at,omitempty" yaml:"disable-field-deleted-at,omitempty" toml:"disable-field-deleted-at,omitempty"`
	// 是否禁用自动添加 gorm tag: column
	DisableGormTagColumn bool `json:"disable-gorm-tag-column,omitempty" yaml:"disable-gorm-tag-column,omitempty" toml:"disable-gorm-tag-column,omitempty"`
	// 是否禁用自动添加字段类型相关的内容
	DisableFieldType bool `json:"disable-field-type,omitempty" yaml:"disable-field-type,omitempty" tom:"disable-field-type,omitempty"`

	// 是否禁用关于错误:数据未找到的指定错误生成
	DisableErrorNotFound bool `json:"disable_error_not_found,omitempty" toml:"disable_error_not_found,omitempty" yaml:"disable-error-not-found,omitempty"`
	// 是否禁用关于错误:唯一键冲突的指定错误生成
	DisableErrorDuplicateKey bool `` /* 134-byte string literal not displayed */
}

type CfgTemplate

type CfgTemplate struct {
	Editorconfig string `json:"editorconfig,omitempty" yaml:"editorconfig,omitempty" toml:"editorconfig,omitempty"`

	Orm        string `json:"orm,omitempty" yaml:"orm,omitempty" toml:"orm,omitempty"`
	TableName  string `json:"table-name,omitempty" yaml:"table-name,omitempty" toml:"table-name,omitempty"`
	TableField string `json:"table-field,omitempty" yaml:"table-field,omitempty" toml:"table-field,omitempty"`

	Proto *CfgProto `json:"proto,omitempty" yaml:"proto,omitempty" toml:"proto,omitempty"`
	Impl  *CfgImpl  `json:"impl,omitempty" yaml:"impl,omitempty" toml:"impl,omitempty"`

	Main string `json:"main,omitempty" yaml:"main,omitempty" toml:"main,omitempty"`

	Conf string `json:"conf,omitempty" yaml:"conf,omitempty" toml:"conf,omitempty"`

	State *CfgTemplateState `json:"state,omitempty" yaml:"state,omitempty" toml:"state,omitempty"`

	Goreleaser   string `json:"goreleaser,omitempty" yaml:"goreleaser,omitempty" toml:"goreleaser,omitempty"`
	Makefile     string `json:"makefile,omitempty" yaml:"makefile,omitempty" toml:"makefile,omitempty"`
	Golangci     string `json:"golangci,omitempty" yaml:"golangci,omitempty" toml:"golangci,omitempty"`
	Gitignore    string `json:"gitignore,omitempty" yaml:"gitignore,omitempty" toml:"gitignore,omitempty"`
	Dockerignore string `json:"dockerignore,omitempty" yaml:"dockerignore,omitempty" toml:"dockerignore,omitempty"`

	I18nConst string `json:"i18n-const,omitempty" yaml:"i18n-const,omitempty" toml:"i18n-const,omitempty"`
}

type CfgTemplateState

type CfgTemplateState struct {
	Table string `json:"table,omitempty" yaml:"table,omitempty" toml:"table,omitempty"`
	Conf  string `json:"conf,omitempty" yaml:"conf,omitempty" toml:"conf,omitempty"`
	Cache string `json:"cache,omitempty" yaml:"cache,omitempty" toml:"cache,omitempty"`
	State string `json:"state,omitempty" yaml:"state,omitempty" toml:"state,omitempty"`
	I18n  string `json:"i18n,omitempty" yaml:"i18n,omitempty" toml:"i18n,omitempty"`
}

type Unmarshaler

type Unmarshaler func(reader io.Reader, v interface{}) error

Jump to

Keyboard shortcuts

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