config

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 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"`

	// global flags
	Debug bool `mapstructure:"debug"`

	// 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

type GenConfig

type GenConfig struct {
	// global flags
	Home  string `mapstructure:"home"`
	Style string `mapstructure:"style"`

	ChangeReplaceTypes        bool     `mapstructure:"change-replace-types"`
	RemoveSuffix              bool     `mapstructure:"remove-suffix"`
	ModelMysqlIgnoreColumns   []string `mapstructure:"model-mysql-ignore-columns"`
	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"`

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

func (*GenConfig) Wd

func (gc *GenConfig) Wd() string

type GenSdkConfig

type GenSdkConfig struct {
	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"`
	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"`
}

func (*GenSwaggerConfig) Wd

func (gc *GenSwaggerConfig) Wd() string

type GenZrpcclientConfig

type GenZrpcclientConfig struct {
	Scope     string `mapstructure:"scope"`
	Output    string `mapstructure:"output"`
	GoModule  string `mapstructure:"goModule"`
	GoPackage string `mapstructure:"goPackage"`
}

type IvmAddApiConfig

type IvmAddApiConfig struct {
	Name     string
	Group    string
	Handlers []string
}

type IvmAddConfig

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

type IvmAddProtoConfig

type IvmAddProtoConfig struct {
	Methods  []string
	Name     string
	Services []string
}

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"`
	ChangeReplaceTypes bool   `mapstructure:"change-replace-types"`
}

type NewConfig

type NewConfig struct {
	Home         string   `mapstructure:"home"`
	Module       string   `mapstructure:"module"`
	Output       string   `mapstructure:"output"`
	Remote       string   `mapstructure:"remote"`
	Cache        bool     `mapstructure:"cache"`
	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