Documentation
¶
Index ¶
- Constants
- Variables
- func LastUsedVersion() (string, error)
- func LatestLoftBinary(ctx context.Context) (string, string, error)
- func LoftAbsoluteWorkingDirectory(version string) (string, error)
- func LoftBinary(ctx context.Context, version string) (string, error)
- func LoftBinaryFilePath(version string) (string, error)
- func LoftConfigFilePath(version string) (string, error)
- func LoftWorkingDirectory(version string) string
- func RunLoftCli(ctx context.Context, version string, args []string) error
- func WriteConfig(c *CLIConfig) error
- type CLIConfig
Constants ¶
const ( VclusterProFolder = "pro" BinariesFolder = "bin" )
Variables ¶
var ( LoftBinaryName = "loft" LoftConfigName = "config.json" )
var ( // ErrNoLastVersion is returned if no last version was found in the config ErrNoLastVersion = errors.New("no vcluster pro version found, please run 'vcluster pro login' first") )
Functions ¶
func LastUsedVersion ¶
LastUsedVersion returns the last used version of the loft cli
func LatestLoftBinary ¶
LatestLoftBinary returns the path to the latest loft binary if it exists
Returns the path to the loft binary and the version tag
func LoftAbsoluteWorkingDirectory ¶
LoftAbsoluteWorkingDirectory returns the absolute path to the loft working directory for the given version
func LoftBinary ¶
LoftBinary returns the path to the loft binary for the given version
Returns the path to the loft binary and the version tag
func LoftBinaryFilePath ¶
LoftBinaryFilePath returns the path to the loft binary for the given version
func LoftConfigFilePath ¶
LoftConfigFilePath returns the path to the loft config file for the given version
func LoftWorkingDirectory ¶
LoftWorkingDirectory returns the path to the loft working directory for the given version
func RunLoftCli ¶
RunLoftCli executes a loft CLI command for the given version with the provided arguments.
It determines the loft binary path and sets the working directory, config file, and env vars needed to run the command.
The CLI arguments are appended to "pro" as the first arg. The command is executed and any error returned.
func WriteConfig ¶
WriteConfig writes the given config to the config file