Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPromptable ¶
func IsPromptable(c Contextualizer) bool
IsPromptable reports whether the output type permits prompts to be shown.
func IsPromptableOnce ¶
func IsPromptableOnce(c Contextualizer, cfg Configurer, key OnceKey) bool
IsPromptableOnce reports whether the given context permits prompts to be shown and also whether a prompt has not been shown before.
func SetPrompted ¶
func SetPrompted(cfg Configurer, key OnceKey) bool
SetPrompted tracks whether a prompt has been called before using the config type and key. A response of true indicates that the config has been updated. A response of false indicates that the config has not been updated. If the configuration "set" call fails, this functions always returns true.
Types ¶
type Configurer ¶
type Configurer interface { GetBool(key string) (value bool) Set(key string, value interface{}) error }
Configurer describes the behavior required to track info via config.
type Contextualizer ¶
type Contextualizer interface {
IsInteractive() bool
}
Contextualizer describes any type which can provide needed contextual info.
Click to show internal directories.
Click to hide internal directories.