Documentation ¶
Index ¶
- type CfgKey
- type CfgKeys
- type CmdParser
- type ENVParser
- type FileParser
- type FlagsParser
- func (parser *FlagsParser) InitBenchmarkFlagSet(cfg *engine.BenchmarkConfig) (*pflag.FlagSet, []MatrixFlagSet)
- func (parser *FlagsParser) InitGeneratorFlagSet(cfg *engine.GeneratorConfig) (*pflag.FlagSet, []MatrixFlagSet)
- func (parser *FlagsParser) InitWriterFlagSet(cfg *engine.WriterConfig) (*pflag.FlagSet, []MatrixFlagSet)
- func (parser *FlagsParser) Print() error
- func (parser *FlagsParser) Usage()
- type MatrixFlagSet
- type MatrixFlagSets
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdParser ¶
type CmdParser struct { *ENVParser // contains filtered or unexported fields }
*
- Parse command from cli into configuration struct
type ENVParser ¶
type ENVParser struct { *FlagsParser // contains filtered or unexported fields }
*
- Parse env into configuration struct
type FileParser ¶
type FileParser struct {
*CmdParser
}
* * Parse toml file into configuration struct. * If the value comes from cli, use the cli value, * Otherwise, override it.
type FlagsParser ¶
type FlagsParser struct { FlagSets MatrixFlagSets RenderGeneratorConfigFunc func(*viper.Viper, engine.GeneratorConfig, bool, ...viper.DecoderConfigOption) (interface{}, error) RenderWriterConfigFunc func(*viper.Viper, engine.WriterConfig, bool, ...viper.DecoderConfigOption) (interface{}, error) RenderBenchmarkConfigFunc func(*viper.Viper, engine.BenchmarkConfig, bool, ...viper.DecoderConfigOption) (interface{}, error) GetGeneratorDefaultFlagsFunc func(engine.GeneratorConfig) (*pflag.FlagSet, interface{}) GetWriterDefaultFlagsFunc func(engine.WriterConfig) (*pflag.FlagSet, interface{}) GetBenchmarkDefaultFlagsFunc func(engine.BenchmarkConfig) (*pflag.FlagSet, interface{}) // contains filtered or unexported fields }
*
- Parse cli flags into configuration struct.
- Print usage info
- Print configuration struct into toml
func (*FlagsParser) InitBenchmarkFlagSet ¶
func (parser *FlagsParser) InitBenchmarkFlagSet(cfg *engine.BenchmarkConfig) (*pflag.FlagSet, []MatrixFlagSet)
func (*FlagsParser) InitGeneratorFlagSet ¶
func (parser *FlagsParser) InitGeneratorFlagSet(cfg *engine.GeneratorConfig) (*pflag.FlagSet, []MatrixFlagSet)
func (*FlagsParser) InitWriterFlagSet ¶
func (parser *FlagsParser) InitWriterFlagSet(cfg *engine.WriterConfig) (*pflag.FlagSet, []MatrixFlagSet)
func (*FlagsParser) Print ¶
func (parser *FlagsParser) Print() error
Print current command line flags in toml format
type MatrixFlagSet ¶
type MatrixFlagSet struct { Label string FSet *pflag.FlagSet SubSet MatrixFlagSets }
type MatrixFlagSets ¶
type MatrixFlagSets []MatrixFlagSet
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Parse ¶
func (parser *Parser) Parse()
Parse command line flags first, then fill env into config secondary, if a --config <file> is given Will read from the config file and override config fields except those arguments listed in the command line. After then, all configuration info is extracted to the cfg struct
Click to show internal directories.
Click to hide internal directories.