config

package
v0.0.0-...-6322789 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDirPath string

ConfigDirPath represents the path to config directory.

View Source
var ConfigFilesPathes map[string]string

ConfigFilesPathes contains every config file pathes per filename.

View Source
var DotfilesDirPath string

DotfilesDirPath represents the full path to the dotfiles directory.

View Source
var IanConfigPath string

IanConfigPath represents the path to ian config directory.

View Source
var Vipers map[string]*viper.Viper

Vipers contains all the initialized Vipers (config, env)

Functions

func AppendToConfig

func AppendToConfig(lines string, confFilename string)

AppendToConfig takes a string as an argument and write it as new line(s) in the given conf file.

func CreateEnvFileWithPreset

func CreateEnvFileWithPreset(preset string)

CreateEnvFileWithPreset write an env file with the selected preset.

func GenerateRepositoriesPath

func GenerateRepositoriesPath() string

GenerateRepositoriesPath creates conf line containing the user's input.

func GetBackendDeveloperPreset

func GetBackendDeveloperPreset() string

GetBackendDeveloperPreset returns the Backend Engineer preset content.

func GetBoolUserInput

func GetBoolUserInput(question string) bool

GetBoolUserInput ask question and return true if the user agreed otherwise false.

func GetConfigDefaultContent

func GetConfigDefaultContent(fileName string) []byte

GetConfigDefaultContent returns the content of the default config.yml (As nothing is preset for now, this function actually returns an empty string)

func GetDefaultSaveMessage

func GetDefaultSaveMessage() string

GetDefaultSaveMessage returns as a string the default save message.

func GetDotfilesRepository

func GetDotfilesRepository() string

GetDotfilesRepository creates conf line containing the user's input.

func GetDotfilesRepositoryPath

func GetDotfilesRepositoryPath() string

GetDotfilesRepositoryPath returns the dotfiles repository path.

func GetFrontendDeveloperPreset

func GetFrontendDeveloperPreset() string

GetFrontendDeveloperPreset returns the Frontend Engineer preset content.

func GetInitialSetupUsage

func GetInitialSetupUsage() []byte

GetInitialSetupUsage returns the usage when using ian for the first time

func GetOpsPreset

func GetOpsPreset() string

GetOpsPreset returns the Ops Engineer preset content.

func GetPreset

func GetPreset(presetName string) []byte

GetPreset returns the content of the preset env.yml

func GetSoftwareEngineerPreset

func GetSoftwareEngineerPreset() string

GetSoftwareEngineerPreset returns the Software Engineer preset content.

func GetUserInput

func GetUserInput(question string) string

GetUserInput ask question and return user input.

func GetUserPrivateInput

func GetUserPrivateInput(question string) string

GetUserPrivateInput ask question and return user input (silent stdin).

func RefreshVipers

func RefreshVipers()

RefreshVipers is a helper called to refresh the configuration.

func SetupConfigFile

func SetupConfigFile(ConfigFileName string)

SetupConfigFile creates a config directory and the config file if not exists.

func SetupConfigFiles

func SetupConfigFiles()

SetupConfigFiles creates a config directory and the config files if not exists.

func UpdateYamlFile

func UpdateYamlFile(fileFullPath string, fileContent map[string]interface{})

UpdateYamlFile write a Viper content to a yaml file.

Types

type YamlConfigMap

type YamlConfigMap struct {
	Managers     map[string]map[string]string `json:"managers"`
	Repositories map[string]string            `json:"repositories"`
	Setup        map[string][]string          `json:"setup"`
	Packages     map[string]map[string]string `json:"packages"`
}

YamlConfigMap is used to marshal/unmarshal config file.

var ConfigMap YamlConfigMap

ConfigMap contains the config content.

Jump to

Keyboard shortcuts

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