Documentation
¶
Overview ¶
Package config handles configuration management for teacli.
Index ¶
- type Config
- func (c *Config) AddServer(name, url, token string) error
- func (c *Config) GetDefaultServer() (*ServerConfig, error)
- func (c *Config) GetDefaultServerName() (string, error)
- func (c *Config) GetServer(name string) (*ServerConfig, error)
- func (c *Config) ListServers() []string
- func (c *Config) RemoveServer(name string) error
- func (c *Config) Save() error
- func (c *Config) SetDefaultServer(name string) error
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the CLI configuration
func LoadFrom ¶ added in v1.0.1
LoadFrom loads configuration from path, or from the default location when path is empty. This is what the --config flag resolves to.
func (*Config) GetDefaultServer ¶
func (c *Config) GetDefaultServer() (*ServerConfig, error)
GetDefaultServer returns the default server configuration
func (*Config) GetDefaultServerName ¶ added in v1.0.2
GetDefaultServerName returns the configured name of the default server.
func (*Config) GetServer ¶
func (c *Config) GetServer(name string) (*ServerConfig, error)
GetServer retrieves a server configuration by name
func (*Config) ListServers ¶
ListServers returns all configured server names
func (*Config) RemoveServer ¶
RemoveServer removes a server configuration
func (*Config) SetDefaultServer ¶
SetDefaultServer sets the default server
type ServerConfig ¶
type ServerConfig struct {
URL string `ini:"url"`
Token string `ini:"token"`
Timeout int `ini:"timeout,omitempty"`
}
ServerConfig holds configuration for a single Gitea server
Click to show internal directories.
Click to hide internal directories.