Documentation ¶
Index ¶
- Variables
- func ByteFormat(inputNum float64, precision int) string
- func ColorPrintYAML(text string)
- func CreateDirectory(path string, mode os.FileMode) error
- func CreateFilePath(destination string) error
- func CreatePathAndCopy(source string, destination string)
- func DockerLogin(serverAddress string, user string, password string) error
- func DownloadToFile(url string, target string)
- func ExecCommand(showLogs bool, envVariables []string, commandName string, args ...string) (string, error)
- func Fetch(url string) io.ReadCloser
- func GetHtpasswdString(username string, password string) (string, error)
- func GetSha256Sum(path string) (string, error)
- func InvalidPath(path string) bool
- func IsRHEL() bool
- func IsUrl(source string) bool
- func IsValidHostName() bool
- func ListDirectories(directory string) ([]string, error)
- func MakeTempDir() (string, error)
- func RandomString(length int) string
- func ReadYaml(path string, destConfig interface{}) error
- func RecursiveFileList(root string, pattern *regexp.Regexp) []string
- func ReplaceText(path string, old string, new string)
- func RoundUp(input float64, places int) (newVal float64)
- func RunPreflightChecks()
- func SwapHost(src string, targetHost string) string
- func ValidHostname(hostname string) bool
- func ValidateSha256Sum(expectedChecksum string, path string)
- func VerifyBinary(binary string) bool
- func WriteFile(path string, data []byte) error
- func WriteYaml(path string, srcConfig interface{}, perm fs.FileMode) error
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
var TempPathPrefix = "zarf-"
Functions ¶
func ByteFormat ¶ added in v0.15.0
func ColorPrintYAML ¶
func ColorPrintYAML(text string)
func CreateDirectory ¶
CreateDirectory creates a directory for the given path and file mode
func CreateFilePath ¶
func CreatePathAndCopy ¶
func DockerLogin ¶ added in v0.15.0
DockerLogin adds the given creds to the user's Docker config, usually located at $HOME/.docker/config.yaml. It does not try to connect to the given registry, it just simply adds another entry to the config file. This function was mostly adapted from https://github.com/google/go-containerregistry/blob/5c9c442d5d68cd96787559ebf6e984c7eb084913/cmd/crane/cmd/auth.go
func DownloadToFile ¶
func ExecCommand ¶
func Fetch ¶
func Fetch(url string) io.ReadCloser
func GetHtpasswdString ¶
GetHtpasswdString converts a username and password to a properly formatted and hashed format for `htpasswd`
func GetSha256Sum ¶
GetSha256Sum returns the computed SHA256 Sum of a given file
func IsValidHostName ¶
func IsValidHostName() bool
func ListDirectories ¶
func MakeTempDir ¶
func RandomString ¶
func RecursiveFileList ¶
RecursiveFileList walks a path with an optional regex pattern and returns a slice of file paths
func ReplaceText ¶
func RunPreflightChecks ¶
func RunPreflightChecks()
func ValidHostname ¶ added in v0.14.0
func ValidateSha256Sum ¶
func VerifyBinary ¶
VerifyBinary returns true if binary is available
Types ¶
type WriteCounter ¶ added in v0.15.0
type WriteCounter struct { Total int // contains filtered or unexported fields }
func NewWriteCounter ¶ added in v0.15.0
func NewWriteCounter(url string, total int) *WriteCounter