Documentation
¶
Index ¶
- Constants
- func AskForConfirmation(s string) bool
- func Base64Decode(s string) (string, error)
- func ConfigForTarget(target types.Target) (interface{}, error)
- func GenerateRandomString(length int) string
- func GenerateTemporarySSHKey(ctx context.Context) (public string, private string, err error)
- func GetTargetsConfigPath() string
- func GitTop() (string, error)
- func KillProcess(pid int) error
- func LoadPtdYaml(filename string) (interface{}, error)
- func OIDCThumbprint(issuerURL string) (string, error)
- func PortOpen(host string, port string) bool
- func ProcessRunning(pid int) bool
- func ReadStruct(filePath string, data interface{}) error
- func RsKeyGenerate() string
- func Sha256Hash(s string, limit int) string
- func SortedKeys[K ~string, V any](m map[K]V) []K
- func TitleCase(s string) string
- func ValidateTargetsConfigPath() error
- func WriteStruct(filePath string, data interface{}) error
- func YamlPathForTarget(target types.Target) string
- type BaseConfig
Constants ¶
const ( CtrlDir = "__ctrl__" WorkDir = "__work__" )
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
func Base64Decode ¶
func ConfigForTarget ¶
func GenerateRandomString ¶
func GenerateTemporarySSHKey ¶
func GetTargetsConfigPath ¶
func GetTargetsConfigPath() string
GetTargetsConfigPath returns the path to the infrastructure directory containing target configurations. Priority:
- Viper config key "targets_config_dir" (can be set via CLI flag, env var, or config file)
- Default: filepath.Join(TOP, "infra")
The path can be:
- Absolute: used as-is
- Relative: resolved relative to TOP
func KillProcess ¶
KillProcess sends SIGKILL to the process group led by pid, so any child processes forked by the target (e.g. the python subprocess spawned by the `az` bash wrapper) are reaped along with it. It expects pid to be the process group leader; callers should spawn with SysProcAttr{Setpgid: true}. If no process group with that leader exists (ESRCH), it falls back to a single-process kill.
func LoadPtdYaml ¶
func OIDCThumbprint ¶
func ProcessRunning ¶
func ReadStruct ¶
ReadStruct reads a struct from a file in JSON format.
func RsKeyGenerate ¶
func RsKeyGenerate() string
func Sha256Hash ¶
func SortedKeys ¶
SortedKeys returns the keys of a map in sorted order.
func ValidateTargetsConfigPath ¶
func ValidateTargetsConfigPath() error
ValidateTargetsConfigPath checks that the targets configuration directory exists and contains the expected directory structure (__ctrl__ and/or __work__ directories). Returns an error with helpful messaging if validation fails.
func WriteStruct ¶
WriteStruct writes a struct to a file in JSON format.