Documentation ¶
Index ¶
- Variables
- func APIURL() string
- func CreateConfig(v *viper.Viper, path, file string) error
- func CreateProjectConfig(projectPath string)
- func DecodeAuth(authStr string) (string, string, error)
- func EncodeAuth(username, password string) string
- func GetDecodedAuth() (string, string, error)
- func InitConfig()
- func ProjectConfigExists() bool
- func ProjectRoot() (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ConfigFileName is the name of the config files (home / project) ConfigFileName = "config" // ConfigFileType is the config file extension ConfigFileType = "yaml" // ConfigFileNameWithExt is the config filename with extension ConfigFileNameWithExt = fmt.Sprintf("%s.%s", ConfigFileName, ConfigFileType) // ConfigDir is the directory for astro files ConfigDir = ".astro" // HomeConfigPath is the path to the users global directory HomeConfigPath = filepath.Join(fileutil.GetHomeDir(), ConfigDir) // HomeConfigFile is the global config file HomeConfigFile = filepath.Join(HomeConfigPath, ConfigFileNameWithExt) // CFGStrMap maintains string to cfg mapping CFGStrMap = make(map[string]cfg) // CFG Houses configuration meta CFG = cfgs{ CloudDomain: newCfg("cloud.domain", true, ""), CloudAPIProtocol: newCfg("cloud.api.protocol", true, "https"), CloudAPIPort: newCfg("cloud.api.port", true, "443"), PostgresUser: newCfg("postgres.user", true, "postgres"), PostgresPassword: newCfg("postgres.password", true, "postgres"), PostgresHost: newCfg("postgres.host", true, "postgres"), PostgresPort: newCfg("postgres.port", true, "5432"), RegistryAuthority: newCfg("docker.registry.authority", true, ""), RegistryAuth: newCfg("docker.registry.auth", true, ""), ProjectName: newCfg("project.name", true, ""), UserAPIAuthToken: newCfg("user.apiAuthToken", true, ""), } )
Functions ¶
func CreateConfig ¶
CreateConfig creates a config file in the given directory
func CreateProjectConfig ¶
func CreateProjectConfig(projectPath string)
CreateProjectConfig creates a project config file
func DecodeAuth ¶ added in v0.0.5
DecodeAuth decodes a base64 encoded string and returns username and password
func EncodeAuth ¶ added in v0.0.5
EncodeAuth creates a base64 encoded string to containing authorization information
func GetDecodedAuth ¶ added in v0.0.5
GetDecodedAuth fetches auth string from config, decodes and returns username password
func ProjectConfigExists ¶
func ProjectConfigExists() bool
ProjectConfigExists returns a boolean indicating if a project config file exists
func ProjectRoot ¶
ProjectRoot returns the path to the nearest project root
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.