config

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *api.Client

Client used for the rest of the commands

View Source
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

func NewGetConfigsCommand() *cobra.Command

NewGetConfigsCommand creates the `configs` command

func NewGetModeCommand

func NewGetModeCommand() *cobra.Command

NewGetModeCommand creates the `mode` command

func SetupClient

func SetupClient() (err error)

SetupClient setups a new API client

func SetupConfigManager

func SetupConfigManager(set *pflag.FlagSet)

SetupConfigManager config manager

Types

type ConfigurationManager

type ConfigurationManager struct {
	Config *api.Config
	// flags below.
	CurrentContext string

	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

Jump to

Keyboard shortcuts

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