Documentation
¶
Overview ¶
Package config handles reading of the user configuration for the client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServerConf ¶
AddServerConf writes a new server configuration into the user config file.
func Path ¶
Path returns the configuration path where configuration files should be stored. If the GIN_CONFIG_DIR environment variable is set, its value is returned, otherwise the platform default is used. If create is true and the directory does not exist, the full path is created.
func RmServerConf ¶
func RmServerConf(alias string)
RmServerConf removes a server configuration from the user config file.
func SetConfig ¶
SetConfig appends a key-value to the configuration file. A useful utility function that loads the configuration only from the file, adds the new key-value pair, and saves it back, without loading the built-in defaults. On successful write, the read cache is invalidated.
func SetDefaultServer ¶
func SetDefaultServer(alias string)
SetDefaultServer writes the given name to the config file to server as the default server for web calls. An error is returned if the name doesn't exist in the current configuration.
Types ¶
type GinCliCfg ¶
type GinCliCfg struct { Servers map[string]ServerCfg DefaultServer string Bin BinCfg Annex AnnexCfg }
GinCliCfg holds the client configuration values.
type GitCfg ¶
GitCfg is the configuration for the git server.
func ParseGitString ¶
ParseGitString takes a string which contains all information about a server's git configuration (e.g., [email protected]:22) and returns a GitCfg struct.
func (GitCfg) AddressStr ¶
AddressStr constructs a full address string from the configuration. The string has the format ssh://User@Host:Port (e.g., ssh://[email protected]:22)
type WebCfg ¶
WebCfg is the configuration for the web server.
func ParseWebString ¶
ParseWebString takes a string which contains all information about a server's web configuration (e.g., https://gin.g-node.org:443) and returns a WebCfg struct.
func (WebCfg) AddressStr ¶
AddressStr constructs a full address string from the configuration. The string has the format Scheme://Host:Port (e.g., https://gin.g-node.org:443)