Documentation
¶
Index ¶
- Variables
- func CheckIfDirectoryExists(filepath string) bool
- func CheckIfFileExists(filepath string) bool
- func CheckIfOnline() bool
- func CheckIfSymlinkExists(filepath string) bool
- func CopyFile(src, dst string) (int64, error)
- func GetAssetFromName(assets map[string]types.ZapDlAsset, assetName string) (types.ZapDlAsset, error)
- func GetFilteredAssets(assets map[string]types.ZapDlAsset) map[string]types.ZapDlAsset
- func GetFirst(assets map[string]types.ZapDlAsset) types.ZapDlAsset
- func HasArch(name string) bool
- func InteractiveSurvey(options InteractiveSurveyOptions) (string, error)
- func ZapAssetNameArray(assets map[string]types.ZapDlAsset) []string
- type InteractiveSurveyOptions
Constants ¶
This section is empty.
Variables ¶
var ARCH = map[string][]string{
"amd64": {"x86_64", "amd64"},
"386": {"i386", "i686"},
"arm": {"arm"},
"arm64": {"armhf", "aarch64"},
}
Functions ¶
func CheckIfDirectoryExists ¶
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 ¶
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 ¶
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 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 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