Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultRequestTimeout time used to timeout all requests to Konstellation APIs. DefaultRequestTimeout = 2 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DefaultRequestTimeout time.Duration `yaml:"defaultRequestTimeout"` DefaultServer string `yaml:"defaultServer"` ServerList []ServerConfig `yaml:"servers"` Debug bool // contains filtered or unexported fields }
Config holds the configuration values for the application.
func NewConfig ¶
func NewConfig() *Config
NewConfig will read the config.yml file from current user home.
func NewConfigTest ¶
func NewConfigTest() *Config
NewConfigTest same as NewConfig but used during tests to create a new file on each test.
func (*Config) AddServer ¶
func (c *Config) AddServer(server ServerConfig) error
AddServer adds a ServerConfig to the config file.
func (*Config) GetByServerName ¶
func (c *Config) GetByServerName(name string) *ServerConfig
GetByServerName returns a ServerConfig for the given server name.
func (*Config) RenderServerList ¶
RenderServerList add server information to the renderer and show it.
func (*Config) SetDefaultServer ¶
SetDefaultServer marks a server name as default to be used when no server parameter is provided.
type ServerConfig ¶
type ServerConfig struct { Name string `yaml:"name"` URL string `yaml:"url"` APIToken string `yaml:"token"` }
ServerConfig contains data to represent a Konstellation server.
Click to show internal directories.
Click to hide internal directories.