Documentation
¶
Index ¶
- Constants
- func CompareConfig(existingConf, currentConf *Config) (bool, []string)
- func ConfigureUserSystemInfo(currentConf *Config)
- func GetStoragePath(os config.OSType, home string) (string, error)
- func InsertConfig(osConfig Config) error
- func ReadDZCliConfig(path string) (collector.AuthConfig, error)
- func ReadDZWorkspaceConfig() (collector.AuthConfig, error)
- func UpdateConfig(osConfig Config) error
- type Config
Constants ¶
const ( YesUpdate string = "Yes, update to new configuration" NoKeep string = "No, keep the existing configuration" )
TODO: set up localization engine for these strings.
Variables ¶
This section is empty.
Functions ¶
func CompareConfig ¶
CompareConfig compares two configuration structs and returns a boolean indicating if there are differences, along with a slice of strings describing what those differences are.
func ConfigureUserSystemInfo ¶
func ConfigureUserSystemInfo(currentConf *Config)
ConfigureUserSystemInfo configures the user system information and prompts the user to update the configuration if necessary.
func GetStoragePath ¶
GetStoragePath returns the path to the devzero storage directory based on the operating system
func InsertConfig ¶
InsertConfig inserts Config used to configure the system
func ReadDZCliConfig ¶
func ReadDZCliConfig(path string) (collector.AuthConfig, error)
ReadDZCliConfig reads the DevZero workspace configuration
func ReadDZWorkspaceConfig ¶
func ReadDZWorkspaceConfig() (collector.AuthConfig, error)
ReadDZWorkspaceConfig reads the DevZero workspace configuration
func UpdateConfig ¶
UpdateConfig updates an existing Config record in the database
Types ¶
type Config ¶
type Config struct {
Id int64 `json:"id" db:"id"`
// OS is the operating system
Os int64 `json:"os" db:"os"`
// OsName is the operating system name
OsName string `json:"os_name" db:"os_name"`
// HomeDir is the user home directory
HomeDir string `json:"home_dir" db:"home_dir"`
// LdaDir is the home LDA directory where all configurations are stored.
LdaDir string `json:"lda_dir" db:"lda_dir"`
// IsRoot is a value to check if the user is root
IsRoot bool `json:"is_root" db:"is_root"`
// ExePath is the path to the lda binary
ExePath string `json:"exe_path" db:"exe_path"`
// ShellTypeToLocation is a map of shell type to location
ShellTypeToLocation map[config.ShellType]string `json:"shell_type_to_location" db:"shell_type_to_location"`
// User is the user that executed the command (if sudo)
User *user.User `json:"-" db:"-"`
}
Config is the basic configuration for the system
var Conf *Config