Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupTicliEnv ¶
SetupTicliEnv initializes the home directory for the Ticli tool. It determines the home directory path based on the "TICLI_HOME" environment variable, if set, or by using platform-specific defaults (e.g., %LOCALAPPDATA%/ticli on Windows or ~/.ticli on Unix-like systems). The function then creates the home directory, including any necessary parent directories, with specific permissions.
Returns:
string: The absolute path to the created or identified home directory. error: An error value if any error occurs while determining the home path or creating the directory. This includes situations where necessary environment variables are not set or if directory creation fails.
Note: The function will log errors using the log package, providing detailed information on failures.
Usage:
homeDir, err := SetupTicliEnv() if err != nil { log.Println(err) }
Types ¶
type ConfigStruct ¶
type ConfigStruct struct { WorkstationConfig WorkstationConfig `json:"workstation_config"` K8sConfigs []K8sConfig `json:"k8s_configs"` Rules []Rule `json:"rules"` }
func LoadConfig ¶
func LoadConfig() (string, ConfigStruct)
type Rule ¶
type Rule struct { Type string `json:"type"` Specification json.RawMessage `json:"specification"` }
type TicliContext ¶
type TicliContext struct { ConfigOrigin string Config ConfigStruct TicliDir string SelectedPlatform string }
type WorkstationConfig ¶
Click to show internal directories.
Click to hide internal directories.