installerx

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package installerx provides utilities for installing various software packages in a streamlined and automated manner. This package is particularly useful for setting up development environments, CI/CD pipelines, and other automated workflows that require the installation of specific software components.

The installerx package includes functions to generate shell commands for downloading and installing software packages, ensuring compatibility with different system architectures and handling any necessary conversions or adjustments.

One of the key features of this package is the ability to generate installation commands for the AWS CLI, a powerful tool for managing AWS services from the command line. The package supports different system architectures, including "x86_64" and "aarch64" (which is converted to "arm64" for compatibility).

Example usage:

package main

import (
	"fmt"
	"installerx"
)

func main() {
	// Generate the installation command for the AWS CLI for the default architecture (x86_64)
	command := installerx.GetAwsCliInstallCommand("")
	fmt.Println(command)

	// Generate the installation command for the AWS CLI for the "aarch64" architecture
	command = installerx.GetAwsCliInstallCommand("aarch64")
	fmt.Println(command)
}

This package is designed to be easy to use and integrate into existing Go projects, providing a simple and efficient way to automate software installations.

Index

Constants

View Source
const (
	// DefaultInstallDir is the default directory for installing binaries
	DefaultInstallDir = "/usr/local/bin"
)

Variables

This section is empty.

Functions

func GetAwsCliInstallCommand added in v0.0.30

func GetAwsCliInstallCommand(architecture string) string

GetAwsCliInstallCommand generates a shell command to download and install the AWS CLI for the specified architecture. If the architecture is not provided, it defaults to "x86_64". The function also handles the conversion of "aarch64" to "arm64" for compatibility.

Parameters:

architecture - a string representing the system architecture (e.g., "x86_64", "aarch64")

Returns:

A string containing the shell command to install the AWS CLI.

func GetOpenTofuInstallCommand added in v0.0.27

func GetOpenTofuInstallCommand(params OpenTofuInstallParams) string

GetOpenTofuInstallCommand returns a string representing the command to install OpenTofu of a specific version.

Parameters: - params: OpenTofuInstallParams struct containing installation parameters

Returns: - A string representing the installation command

func GetTerraformInstallCommand added in v0.0.27

func GetTerraformInstallCommand(params TerraformInstallParams) string

GetTerraformInstallCommand returns a string representing the command to install Terraform of a specific version.

Parameters: - params: TerraformInstallParams struct containing installation parameters

Returns: - A string representing the installation command

func GetTerragruntInstallCommand added in v0.0.27

func GetTerragruntInstallCommand(params TerragruntInstallParams) string

GetTerragruntInstallCommand returns a string representing the command to install Terragrunt of a specific version.

Parameters: - params: TerragruntInstallParams struct containing installation parameters

Returns: - A string representing the installation command

Types

type OpenTofuInstallParams added in v0.0.28

type OpenTofuInstallParams struct {
	// Version of OpenTofu to install (e.g., "1.6.0")
	Version string
	// InstallDir is the directory to install OpenTofu. If empty, defaults to DefaultInstallDir
	InstallDir string
}

OpenTofuInstallParams represents the parameters for installing OpenTofu

type TerraformInstallParams added in v0.0.28

type TerraformInstallParams struct {
	// Version of Terraform to install (e.g., "1.0.0")
	Version string
	// InstallDir is the directory to install Terraform. If empty, defaults to DefaultInstallDir
	InstallDir string
}

TerraformInstallParams represents the parameters for installing Terraform

type TerragruntInstallParams added in v0.0.28

type TerragruntInstallParams struct {
	// Version of Terragrunt to install (e.g., "0.38.0")
	Version string
	// InstallDir is the directory to install Terragrunt. If empty, defaults to "/usr/local/bin"
	InstallDir string
}

TerragruntInstallParams represents the parameters for installing Terragrunt

Jump to

Keyboard shortcuts

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