Documentation ¶
Overview ¶
Package option provides utilities of option handling
Index ¶
- Variables
- func RegisterBoolFlag(cmd *cobra.Command, flagConfig *BoolFlag) error
- func RegisterFlag(cmd *cobra.Command, flag Flag) error
- func RegisterFlags(cmd *cobra.Command, flags []Flag) error
- func RegisterFloat32Flag(cmd *cobra.Command, flagConfig *Float32Flag) error
- func RegisterFloat64Flag(cmd *cobra.Command, flagConfig *Float64Flag) error
- func RegisterInt16Flag(cmd *cobra.Command, flagConfig *Int16Flag) error
- func RegisterInt32Flag(cmd *cobra.Command, flagConfig *Int32Flag) error
- func RegisterInt64Flag(cmd *cobra.Command, flagConfig *Int64Flag) error
- func RegisterInt8Flag(cmd *cobra.Command, flagConfig *Int8Flag) error
- func RegisterIntFlag(cmd *cobra.Command, flagConfig *IntFlag) error
- func RegisterStringFlag(cmd *cobra.Command, flagConfig *StringFlag) error
- func RegisterUint16Flag(cmd *cobra.Command, flagConfig *Uint16Flag) error
- func RegisterUint32Flag(cmd *cobra.Command, flagConfig *Uint32Flag) error
- func RegisterUint64Flag(cmd *cobra.Command, flagConfig *Uint64Flag) error
- func RegisterUint8Flag(cmd *cobra.Command, flagConfig *Uint8Flag) error
- func RegisterUintFlag(cmd *cobra.Command, flagConfig *UintFlag) error
- type AssetAddCmdConfig
- type AssetDeleteCmdConfig
- type AssetListCmdConfig
- type BaseFlag
- type BoolFlag
- type Flag
- type Float32Flag
- type Float64Flag
- type Int16Flag
- type Int32Flag
- type Int64Flag
- type Int8Flag
- type IntFlag
- type MigrateCmdConfig
- type RawAssetAddCmdConfig
- type RevalidateCmdConfig
- type RootCmdConfig
- type StringFlag
- type TagListCmdConfig
- type Uint16Flag
- type Uint32Flag
- type Uint64Flag
- type Uint8Flag
- type UintFlag
Constants ¶
This section is empty.
Variables ¶
var DefaultStringValue = "__DEFAULT_STRING_VALUE__"
Functions ¶
func RegisterBoolFlag ¶
RegisterBoolFlag register bool flag to provided cmd and viper
func RegisterFlag ¶
RegisterFlag register flag to provided cmd and viper
func RegisterFlags ¶
RegisterFlags register flags to provided cmd and viper
func RegisterFloat32Flag ¶
func RegisterFloat32Flag(cmd *cobra.Command, flagConfig *Float32Flag) error
RegisterFloat32Flag register int32 flag to provided cmd and viper
func RegisterFloat64Flag ¶
func RegisterFloat64Flag(cmd *cobra.Command, flagConfig *Float64Flag) error
RegisterFloat64Flag register int64 flag to provided cmd and viper
func RegisterInt16Flag ¶
RegisterInt16Flag register int16 flag to provided cmd and viper
func RegisterInt32Flag ¶
RegisterInt32Flag register int32 flag to provided cmd and viper
func RegisterInt64Flag ¶
RegisterInt64Flag register int64 flag to provided cmd and viper
func RegisterInt8Flag ¶
RegisterInt8Flag register int8 flag to provided cmd and viper
func RegisterIntFlag ¶
RegisterIntFlag register int flag to provided cmd and viper
func RegisterStringFlag ¶
func RegisterStringFlag(cmd *cobra.Command, flagConfig *StringFlag) error
RegisterStringFlag register string flag to provided cmd and viper
func RegisterUint16Flag ¶
func RegisterUint16Flag(cmd *cobra.Command, flagConfig *Uint16Flag) error
RegisterUint16Flag register int16 flag to provided cmd and viper
func RegisterUint32Flag ¶
func RegisterUint32Flag(cmd *cobra.Command, flagConfig *Uint32Flag) error
RegisterUint32Flag register int32 flag to provided cmd and viper
func RegisterUint64Flag ¶
func RegisterUint64Flag(cmd *cobra.Command, flagConfig *Uint64Flag) error
RegisterUint64Flag register int64 flag to provided cmd and viper
func RegisterUint8Flag ¶
RegisterUint8Flag register int8 flag to provided cmd and viper
Types ¶
type AssetAddCmdConfig ¶
type AssetAddCmdConfig struct { *RawAssetAddCmdConfig Queries []*model.Query }
AssetAddCmdConfig is config for eval command
func NewAssetAddCmdConfigFromViper ¶
func NewAssetAddCmdConfigFromViper(args []string) (*AssetAddCmdConfig, error)
NewAssetAddCmdConfigFromViper generate config for eval command from viper
type AssetDeleteCmdConfig ¶
AssetDeleteCmdConfig is config for eval command
func NewAssetDeleteCmdConfigFromViper ¶
func NewAssetDeleteCmdConfigFromViper(args []string) (*AssetDeleteCmdConfig, error)
NewAssetDeleteCmdConfigFromViper generate config for eval command from viper
type AssetListCmdConfig ¶
AssetListCmdConfig is config for eval command
func NewAssetListCmdConfigFromViper ¶
func NewAssetListCmdConfigFromViper(args []string) (*AssetListCmdConfig, error)
NewAssetListCmdConfigFromViper generate config for eval command from viper
type BaseFlag ¶
type BaseFlag struct { IsPersistent bool IsRequired bool Shorthand string Name string Usage string ViperName string }
BaseFlag represents base command line flag
type Flag ¶
type Flag interface {
// contains filtered or unexported methods
}
Flag represents flag which has base flag
type Float32Flag ¶
Float32Flag represents flag which can be specified as float32
type Float64Flag ¶
Float64Flag represents flag which can be specified as float64
type MigrateCmdConfig ¶
MigrateCmdConfig is config for eval command
func NewMigrateCmdConfigFromViper ¶
func NewMigrateCmdConfigFromViper(args []string) (*MigrateCmdConfig, error)
NewMigrateCmdConfigFromViper generate config for eval command from viper
type RawAssetAddCmdConfig ¶ added in v0.1.6
AssetAddCmdConfig is config for asset update command
type RevalidateCmdConfig ¶
RevalidateCmdConfig is config for eval command
func NewRevalidateCmdConfigFromViper ¶
func NewRevalidateCmdConfigFromViper(args []string) (*RevalidateCmdConfig, error)
NewRevalidateCmdConfigFromViper generate config for eval command from viper
type RootCmdConfig ¶
type RootCmdConfig struct { Verbose bool DB string Dev bool BasePath string `mapstructure:"basepath"` UiPort uint `mapstructure:"ui-port"` AssetPort uint `mapstructure:"asset-port"` }
RootCmdConfig is config for root command
func NewRootCmdConfigFromViper ¶
func NewRootCmdConfigFromViper() (*RootCmdConfig, error)
NewRootCmdConfigFromViper generate config for sum command from viper
type StringFlag ¶
StringFlag represents flag which can be specified as string
type TagListCmdConfig ¶
TagListCmdConfig is config for eval command
func NewTagListCmdConfigFromViper ¶
func NewTagListCmdConfigFromViper(args []string) (*TagListCmdConfig, error)
NewTagListCmdConfigFromViper generate config for eval command from viper
type Uint16Flag ¶
Uint16Flag represents flag which can be specified as uint16
type Uint32Flag ¶
Uint32Flag represents flag which can be specified as uint32
type Uint64Flag ¶
Uint64Flag represents flag which can be specified as uint64