Documentation
¶
Overview ¶
Package config provides commands for a CLI config management.
Index ¶
- func AddEnvironmentToConfig(c *cli.Context, cfg *CLIConfig, environmentID string) error
- func BuildFileName(dirname string) string
- func CommandList() []*cli.Command
- func GetDirname() (string, error)
- func GetFilename() (string, error)
- func SaveConfig(filename string, cfg *CLIConfig) error
- type CLIConfig
- type Environment
- type Forwarding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEnvironmentToConfig ¶
AddEnvironmentToConfig adds a new environment to CLIConfig.
func BuildFileName ¶
BuildFileName builds a config filename.
func CommandList ¶
func CommandList() []*cli.Command
CommandList returns available commands for a CLI config management.
func GetDirname ¶
GetDirname returns the CLI config path located in the current user's home directory.
func GetFilename ¶
GetFilename returns the CLI config filename located in the current user's home directory.
func SaveConfig ¶
SaveConfig persists a CLI config.
Types ¶
type CLIConfig ¶
type CLIConfig struct {
CurrentEnvironment string `yaml:"current_environment" json:"current_environment"`
Environments map[string]Environment `yaml:"environments" json:"environments"`
}
CLIConfig defines a format of CLI configuration.
type Environment ¶
type Environment struct {
EnvironmentID string `yaml:"-" json:"environment_id"`
URL string `yaml:"url" json:"url"`
Token string `yaml:"token" json:"token"`
Insecure bool `yaml:"insecure" json:"insecure"`
Forwarding Forwarding `yaml:"forwarding" json:"forwarding"`
}
Environment defines a format of environment configuration.
type Forwarding ¶
type Forwarding struct {
ServerURL string `yaml:"server_url" json:"server_url"`
LocalPort string `yaml:"local_port" json:"local_port"`
IdentityFile string `yaml:"identity_file" json:"identity_file"`
}
Forwarding defines configuration for port forwarding.
Click to show internal directories.
Click to hide internal directories.