Documentation ¶
Index ¶
- func EnvVar(flag string) string
- func FlagDesc(desc, envVar string) string
- func PrintJSON(fnc func(cmd *cobra.Command, args []string) (interface{}, error)) func(cmd *cobra.Command, args []string) error
- func SanitizeFlagName(flag string) string
- func ViperFromContext(ctx context.Context) *viper.Viper
- func ViperKey(flag string) string
- func WithViper(ctx context.Context, v *viper.Viper) context.Context
- type FlagPrefixer
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeFlagName ¶
Types ¶
type FlagPrefixer ¶
type FlagPrefixer struct {
// contains filtered or unexported fields
}
func NewFlagPrefixer ¶
func NewFlagPrefixer(prefix string, opts ...Option) FlagPrefixer
func (FlagPrefixer) Env ¶
func (fl FlagPrefixer) Env(s string) string
func (FlagPrefixer) FlagName ¶
func (fl FlagPrefixer) FlagName(s string) string
func (FlagPrefixer) Prefix ¶
func (fl FlagPrefixer) Prefix() string
func (FlagPrefixer) ViperKey ¶
func (fl FlagPrefixer) ViperKey(s string) string
Click to show internal directories.
Click to hide internal directories.