helpers

package
v0.0.0-...-ef44059 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ARCH = map[string][]string{
	"amd64": {"x86_64", "amd64"},
	"386":   {"i386", "i686"},
	"arm":   {"arm"},
	"arm64": {"armhf", "aarch64"},
}

Functions

func CheckIfDirectoryExists

func CheckIfDirectoryExists(filepath string) bool

CheckIfDirectoryExists checks if a file exists and is not a directory before we try using it to prevent further errors. Returns true if it does, false otherwise.

func CheckIfFileExists

func CheckIfFileExists(filepath string) bool

CheckIfFileExists checks if a file exists and is not a directory before we try using it to prevent further errors. Returns true if it does, false otherwise.

func CheckIfOnline

func CheckIfOnline() bool

func CheckIfSymlinkExists

func CheckIfSymlinkExists(filepath string) bool

CheckIfSymlinkExists checks if a file exists and is not a directory before we try using it to prevent further errors. Returns true if it does, false otherwise.

func CopyFile

func CopyFile(src, dst string) (int64, error)

func GetAssetFromName

func GetAssetFromName(assets map[string]types.ZapDlAsset, assetName string) (types.ZapDlAsset, error)

func GetFilteredAssets

func GetFilteredAssets(assets map[string]types.ZapDlAsset) map[string]types.ZapDlAsset

func GetFirst

func GetFirst(assets map[string]types.ZapDlAsset) types.ZapDlAsset

func HasArch

func HasArch(name string) bool

func InteractiveSurvey

func InteractiveSurvey(options InteractiveSurveyOptions) (string, error)

InteractiveSurvey creates a interactive survey command line instance, which will be instantiated if the number of choices are more than one. If the number of choices are one, the only choice will be returned. If the choices are empty, it will create an error

func ZapAssetNameArray

func ZapAssetNameArray(assets map[string]types.ZapDlAsset) []string

Types

type InteractiveSurveyOptions

type InteractiveSurveyOptions struct {
	Classifier string
	Array      []string
	Default    string
	Options    types.InstallOptions
}

InteractiveSurveyOptions provides the possible configuration which can be passed to InteractiveSurvey

Jump to

Keyboard shortcuts

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