cliutils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(cmd *cobra.Command, flags []CobraFlagOptions) error

func BindAWSCreds

func BindAWSCreds() error

func GenerateExampleInCMD

func GenerateExampleInCMD(examples []ExampleTemplateOptions) string

func GetCMDContext

func GetCMDContext(c *cobra.Command, key string) interface{}

GetCMDContext returns the context of a cobra command.

func GetViperEnvVarPrefix

func GetViperEnvVarPrefix(prefix string) string

func InitViperConfig

func InitViperConfig(options ViperConfigOptions) error

Types

type CobraFlagOptions

type CobraFlagOptions struct {
	ShortName                string
	LongName                 string
	Usage                    string
	DefaultValue             interface{}
	FlagType                 string
	FailIfEnvVarBindingFails bool
	IsPersistent             bool
	ViperBindingCfg          CobraViperBindingOptions
	IsRequired               bool
}

type CobraViperBindingOptions

type CobraViperBindingOptions struct {
	EnvVariableNameInViper string
	EnvVariableNameInHost  string
	IsEnabled              bool
}

type ExampleTemplateOptions

type ExampleTemplateOptions struct {
	CLIName     string
	Command     string
	Options     string
	Explanation string
	Title       string
}

type Key added in v1.0.2

type Key int

func GetCtxKey added in v1.0.2

func GetCtxKey() Key

type ViperConfigOptions

type ViperConfigOptions struct {
	CfgFile       string
	CfgName       string
	CfgFileType   string
	EnvVarsPrefix string
}

Jump to

Keyboard shortcuts

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