configcmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() *cli.Command

func TrySetConfigFromFile

func TrySetConfigFromFile(c *cli.Context) error

Get available configuration settings from supplied or default configuration file.

Types

type Config

type Config struct {
	ActiveConfig   string                   `mapstructure:"active_configuration" yaml:"active_configuration"`
	Configurations map[string]Configuration `mapstructure:"configurations"`
	// contains filtered or unexported fields
}

func LoadConfiguration

func LoadConfiguration(path string) (*Config, error)

Loads configuration settings from specified file path.

func (*Config) PrintConfigurationContent

func (c *Config) PrintConfigurationContent(name string) error

Print specified configuration to stdout.

func (*Config) PrintConfigurations

func (c *Config) PrintConfigurations()

func (*Config) SetActive

func (c *Config) SetActive(name string) error

func (*Config) UpdateConfiguration

func (c *Config) UpdateConfiguration(key string, value string) error

type Configuration

type Configuration struct {
	Username         string `mapstructure:"username" yaml:"username"`
	Token            string `mapstructure:"token" yaml:"token"`
	DefaultDomainID  string `mapstructure:"domain-id" yaml:"domain-id"`
	DefaultRegion    string `mapstructure:"region" yaml:"region"`
	DefaultProjectID string `mapstructure:"project-id" yaml:"project-id"`
}

Jump to

Keyboard shortcuts

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