Documentation
¶
Index ¶
- Variables
- func CI() (string, string, string)
- func ConvertHCLtoTOML(oldpath string, newpath string, file string)
- func GetToken() string
- func LoadConfig(configpath string, configname string) *viper.Viper
- func LoadMainConfig() (string, string, string, string, bool)
- func New(confpath string, r io.Reader) error
- func UserConfigError()
- func WriteConfigEntry(desc string, value interface{}, configpath string, configname string)
Constants ¶
This section is empty.
Variables ¶
var MainConfig *viper.Viper
MainConfig represents the loaded config
var WorktreeConfigName string = "lab"
default path of worktree lab.toml file
Functions ¶
func CI ¶ added in v0.13.0
CI returns credentials suitable for use within GitLab CI or empty strings if none found.
func ConvertHCLtoTOML ¶ added in v0.21.0
ConvertHCLtoTOML converts an .hcl file to a .toml file
func GetToken ¶ added in v0.21.0
func GetToken() string
GetToken returns a token string from the config file. The token string can be cleartext or returned from a password manager or encryption utility.
func LoadConfig ¶ added in v0.21.0
LoadConfig loads a config file specified by configpath and configname. The configname must not have a '.toml' extension. If configpath and/or configname are unspecified, the worktree defaults will be used.
func LoadMainConfig ¶ added in v0.21.0
LoadMainConfig loads the main config file and returns a tuple of
host, user, token, ca_file, skipVerify
func New ¶
New prompts the user for the default config values to use with lab, and save them to the provided confpath (default: ~/.config/lab.hcl)
func UserConfigError ¶ added in v0.21.0
func UserConfigError()
UserConfigError returns a default error message about authentication
func WriteConfigEntry ¶ added in v0.21.0
WriteConfigEntry writes a value specified by desc and value to the configfile specified by configpath and configname. If configpath and/or configname are unspecified, the worktree defaults will be used.
Types ¶
This section is empty.