Documentation
¶
Index ¶
- Constants
- func ConsulInit(token string, env string, profile string) *api.Client
- func FileExists(filename string) bool
- func FindProfile() ([]string, []prompt.Suggest)
- func GetEnv(profile string) (string, string)
- func GetPlatformId(c *api.Client) []prompt.Suggest
- func GetPlatformNames(c *api.Client) []prompt.Suggest
- func GetSecret(dc string, profile string) (string, error)
- type CobraPrompt
Constants ¶
View Source
const CALLBACK_ANNOTATION = "cobra-prompt"
CALLBACK_ANNOTATION
Variables ¶
This section is empty.
Functions ¶
func ConsulInit ¶ added in v0.2.0
func FindProfile ¶ added in v0.2.0
func FindProfile() ([]string, []prompt.Suggest)
find the profiles on the existing machine
func GetPlatformId ¶ added in v0.2.0
func GetPlatformNames ¶ added in v0.2.0
Types ¶
type CobraPrompt ¶
type CobraPrompt struct { // RootCmd is the start point, all its sub commands and flags will be available as suggestions RootCmd *cobra.Command // GoPromptOptions is for customize go-prompt // see https://github.com/c-bata/go-prompt/blob/master/option.go GoPromptOptions []prompt.Option // DynamicSuggestionsFunc will be executed if an command has CALLBACK_ANNOTATION as an annotation. If it's included // the value will be provided to the DynamicSuggestionsFunc function. DynamicSuggestionsFunc func(annotation string, document prompt.Document) []prompt.Suggest // ResetFlagsFlag will add a new persistent flag to RootCmd. This flags can be used to turn off flags value reset ResetFlagsFlag bool Consul *api.Client }
CobraPrompt requires RootCmd to run
func (CobraPrompt) Run ¶
func (co CobraPrompt) Run()
Run will automatically generate suggestions for all cobra commands and flags defined by RootCmd and execute the selected commands. Run will also reset all given flags by default, see ResetFlagsFlag
Click to show internal directories.
Click to hide internal directories.