Documentation
¶
Overview ¶
Package cli provides CLI tool dependency detection and installation.
Index ¶
- func GetArch() string
- func GetPlatform() string
- func PrintDependencyStatus(deps []DependencyStatus)
- func PrintInstallationError(name string, err error)
- func PrintInstallationStart(name string)
- func PrintInstallationSuccess(name string)
- func PromptForInstall(missing []DependencyStatus) (bool, error)
- func PromptForSingleInstall(dep DependencyStatus) (bool, error)
- type DependencyChecker
- type DependencyStatus
- type InstallOptions
- type Installer
- func (i *Installer) Install(ctx context.Context, name string, opts InstallOptions) error
- func (i *Installer) InstallAWSCLI(ctx context.Context, opts InstallOptions) error
- func (i *Installer) InstallEksctl(ctx context.Context, opts InstallOptions) error
- func (i *Installer) InstallKubectl(ctx context.Context, opts InstallOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPlatform ¶
func GetPlatform() string
GetPlatform returns the current platform (linux, darwin)
func PrintDependencyStatus ¶
func PrintDependencyStatus(deps []DependencyStatus)
PrintDependencyStatus prints a summary of dependency status
func PrintInstallationError ¶
PrintInstallationError prints an error message if installation fails
func PrintInstallationStart ¶
func PrintInstallationStart(name string)
PrintInstallationStart prints a message when starting installation
func PrintInstallationSuccess ¶
func PrintInstallationSuccess(name string)
PrintInstallationSuccess prints a success message after installation
func PromptForInstall ¶
func PromptForInstall(missing []DependencyStatus) (bool, error)
PromptForInstall asks user permission to install missing tools Returns true if the user approves installation
func PromptForSingleInstall ¶
func PromptForSingleInstall(dep DependencyStatus) (bool, error)
PromptForSingleInstall asks permission to install a single tool
Types ¶
type DependencyChecker ¶
type DependencyChecker struct {
// contains filtered or unexported fields
}
DependencyChecker handles detection of CLI tools
func NewDependencyChecker ¶
func NewDependencyChecker(debug bool) *DependencyChecker
NewDependencyChecker creates a new dependency checker
func (*DependencyChecker) CheckAWSCLI ¶
func (d *DependencyChecker) CheckAWSCLI() DependencyStatus
CheckAWSCLI checks if AWS CLI v2 is installed
func (*DependencyChecker) CheckAll ¶
func (d *DependencyChecker) CheckAll() []DependencyStatus
CheckAll checks all K8s related dependencies
func (*DependencyChecker) CheckEksctl ¶
func (d *DependencyChecker) CheckEksctl() DependencyStatus
CheckEksctl checks if eksctl is installed
func (*DependencyChecker) CheckKubectl ¶
func (d *DependencyChecker) CheckKubectl() DependencyStatus
CheckKubectl checks if kubectl is installed
func (*DependencyChecker) CheckMissing ¶
func (d *DependencyChecker) CheckMissing() []DependencyStatus
CheckMissing returns only the missing or invalid dependencies
type DependencyStatus ¶
type DependencyStatus struct {
Name string
Installed bool
Version string
Required bool
MinVersion string
Message string
}
DependencyStatus represents the status of a CLI tool
type InstallOptions ¶
type InstallOptions struct {
Sudo bool // Use sudo for installation
InstallPath string // Where to install binaries (default: /usr/local/bin)
}
InstallOptions contains options for installation
func DefaultInstallOptions ¶
func DefaultInstallOptions() InstallOptions
DefaultInstallOptions returns sensible defaults
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer handles installation of CLI tools
func NewInstaller ¶
NewInstaller creates a new installer for the current platform
func (*Installer) InstallAWSCLI ¶
func (i *Installer) InstallAWSCLI(ctx context.Context, opts InstallOptions) error
InstallAWSCLI installs AWS CLI v2
func (*Installer) InstallEksctl ¶
func (i *Installer) InstallEksctl(ctx context.Context, opts InstallOptions) error
InstallEksctl installs eksctl
func (*Installer) InstallKubectl ¶
func (i *Installer) InstallKubectl(ctx context.Context, opts InstallOptions) error
InstallKubectl installs kubectl