pro

package
v0.16.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VclusterProFolder = "pro"
	BinariesFolder    = "bin"
)

Variables

View Source
var (
	LoftBinaryName = "loft"
	LoftConfigName = "config.json"
)
View Source
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

func LastUsedVersion() (string, error)

LastUsedVersion returns the last used version of the loft cli

func LatestLoftBinary

func LatestLoftBinary(ctx context.Context) (string, string, error)

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

func LoftAbsoluteWorkingDirectory(version string) (string, error)

LoftAbsoluteWorkingDirectory returns the absolute path to the loft working directory for the given version

func LoftBinary

func LoftBinary(ctx context.Context, version string) (string, error)

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

func LoftBinaryFilePath(version string) (string, error)

LoftBinaryFilePath returns the path to the loft binary for the given version

func LoftConfigFilePath

func LoftConfigFilePath(version string) (string, error)

LoftConfigFilePath returns the path to the loft config file for the given version

func LoftWorkingDirectory

func LoftWorkingDirectory(version string) string

LoftWorkingDirectory returns the path to the loft working directory for the given version

func RunLoftCli

func RunLoftCli(ctx context.Context, version string, args []string) error

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

func WriteConfig(c *CLIConfig) error

WriteConfig writes the given config to the config file

Types

type CLIConfig

type CLIConfig struct {
	LatestVersion   string    `json:"latestVersion,omitempty"`
	LatestCheckAt   time.Time `json:"latestCheck,omitempty"`
	LastUsedVersion string    `json:"lastUsedVersion,omitempty"`
}

CLIConfig is the config of the CLI

func GetConfig

func GetConfig() (*CLIConfig, error)

GetConfig returns the config from the config file

Jump to

Keyboard shortcuts

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