config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AltConfPath string = "."

AltConfPath is the default alternate config path

View Source
const AlwaysConfirm bool = false

AlwaysConfirm is the default setting for the auto-confirm flag

View Source
const AlwaysPreferGit bool = false

AlwaysPreferGit is the default setting for the prefer-git flag

View Source
const AlwaysShow bool = false

AlwaysShow is the default setting for the show flag

View Source
const AlwaysVerbose bool = false

AlwaysVerbose is the default setting for the verbose global flag

View Source
const AlwaysWriteInPlace bool = false

AlwaysWriteInPlace is the default setting for the write-in-place flag

View Source
const ConfigFile string = ".pufctl"

ConfigFile is the default config file name (not file extension)

View Source
const ConfigFileExtension string = "yaml"

ConfigFileExtension is the default config file extension

View Source
const DocGenPath string = "./doc/"

DocGenPath is the default directory path where all docs will be generated

View Source
const EnvVarPrefix string = "PUF"

EnvVarPrefix is the default prefix for config environment variables

View Source
const ForgeAPI string = "https://forgeapi-cdn.puppet.com"

ForgeAPI is the default URL for the forge-url flag

View Source
const Puppetfile string = "./Puppetfile"

Puppetfile is the default Puppetfile path

View Source
const PuppetfileBranch string = "production"

PuppetfileBranch is the branch to use with the configured Puppetfile is you are using a Puppetfile from a Git source.

Variables

View Source
var (

	// ConfPath is the default path to directory that houses the config file
	ConfPath string = homeDir

	// FullConfPath is the full path to (and including) the config file
	FullConfPath string = fmt.Sprintf("%s/%s.%s", homeDir, ConfigFile, ConfigFileExtension)

	// SSHKeyPath is the default path for an SSH key
	SSHKeyPath string = fmt.Sprintf("%s/.ssh/id_rsa", homeDir)

	// ForgeStrDefaults is a map of default values under the "forge" config key
	// used in setting Viper defaults. The key user_agent is set at runtime.
	ForgeStrDefaults = map[string]string{
		"user_agent": "",
		"api_url":    ForgeAPI,
	}

	//AlwaysBoolDefaults is a map of default values under the "always" config key
	// used in setting Viper defaults.
	AlwaysBoolDefaults = map[string]bool{
		"verbose":        AlwaysVerbose,
		"show":           AlwaysShow,
		"prefer_git":     AlwaysPreferGit,
		"write_in_place": AlwaysWriteInPlace,
	}

	// AuthStrDefaults is a map of default values under the "auth" config key
	// used in setting Viper defaults.
	AuthStrDefaults = map[string]string{
		"ssh_key":  SSHKeyPath,
		"username": userName,
		"password": "",
		"token":    "",
	}

	// GenoptsStrDefaults is a map of default values under the "genopts" config key
	// used in setting Viper defaults.
	GenoptsStrDefaults = map[string]string{
		"doc_gen_path": DocGenPath,
	}
)

Functions

func GetUsernameAndHomedir

func GetUsernameAndHomedir() (string, string)

GetUsernameAndHomedir returns the current user's username and home directory or, if an error occurs in determining the current user, these anonymous defaults: username: "" homedir: "."

Types

This section is empty.

Jump to

Keyboard shortcuts

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