Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Client *api.Client = &api.Client{}
Client used for the rest of the commands. The majority of the code relies on this client being available as a global variable. While this technically works, it's not great for testing via DI, injecting either a mocked or real implementation. To fascilitate this without a massive refactor, we promise now that Client always points to the same api.Client, and contents of it will get updated on client instantation. This allows dependency injection of "the thing that will become the client" into wherever it is needed before the thing becomes the client. Not too elegant, but it works and saves a lot of work. This are a lot of words to say: HACK.
var DefaultConfigFilepath = filepath.Join(api.DefaultConfigurationHomeDir, "lenses-cli.yml")
DefaultConfigFilepath the default config file path
Functions ¶
func DecryptPassword ¶
func DecryptPassword(cfg *api.ClientConfig)
DecryptPassword decrypts the password by provided client configuration
func EncryptPassword ¶
func EncryptPassword(cfg *api.ClientConfig) error
EncryptPassword encrypts the password by provided client configuration
func NewGetConfigsCommand ¶
NewGetConfigsCommand creates the `configs` command
func NewGetModeCommand ¶
NewGetModeCommand creates the `mode` command
func SetupConfigManager ¶
SetupConfigManager config manager
Types ¶
type ConfigurationManager ¶
type ConfigurationManager struct { Config *api.Config // flags below. CurrentContext string WaitForLenses bool Filepath string // contains filtered or unexported fields }
ConfigurationManager manager for config
var Manager *ConfigurationManager
Manager the config manager
func NewConfigurationManager ¶
func NewConfigurationManager(set *pflag.FlagSet) *ConfigurationManager
NewConfigurationManager creates a configuration
func NewEmptyConfigManager ¶
func NewEmptyConfigManager() *ConfigurationManager
NewEmptyConfigManager creates an empty configuration
func (*ConfigurationManager) Load ¶
func (m *ConfigurationManager) Load() (bool, error)
Load loads the configuration
func (*ConfigurationManager) Save ¶
func (m *ConfigurationManager) Save() error
Save saves the configuration