Documentation ¶
Overview ¶
Forked from https://github.com/sigstore/cosign/blob/v1.7.1/pkg/sget/sget.go
Index ¶
- Constants
- 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) error
- func DoesHostnamesMatch(url1 string, url2 string) (bool, error)
- func DownloadToFile(url string, target string, cosignKeyPath string)
- func ExecCommandWithContext(ctx context.Context, showLogs bool, commandName string, args ...string) (string, string, error)
- func ExecCommandWithContextAndDir(ctx context.Context, dir string, showLogs bool, commandName string, ...) (string, string, error)
- func ExecLaunchURL(url string) error
- func Fetch(url string) io.ReadCloser
- func FindYamlTemplates(config any, prefix string, suffix string) (map[string]*string, error)
- func GetFinalExecutablePath() (string, error)
- 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(tmpDir string) (string, error)
- func RandomString(length int) string
- func ReadYaml(path string, destConfig any) error
- func RecursiveFileList(dir string, pattern *regexp.Regexp) (files []string, err error)
- func ReloadYamlTemplate(config any, mappings map[string]string) error
- func ReplaceTextTemplate(path string, mappings map[string]string)
- func RoundUp(input float64, places int) (newVal float64)
- func RunPreflightChecks()
- func Sget(image, key string, out io.Writer, ctx context.Context) error
- func SwapHost(src string, targetHost string) (string, error)
- func SwapHostWithoutChecksum(src string, targetHost string) (string, error)
- 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 any, perm fs.FileMode) error
- type Image
Constants ¶
const SGETProtocol = "sget://"
Variables ¶
var TempPathPrefix = "zarf-"
Functions ¶
func ByteFormat ¶
func ColorPrintYAML ¶
func ColorPrintYAML(text string)
func CreateDirectory ¶
CreateDirectory creates a directory for the given path and file mode
func CreateFilePath ¶
func CreatePathAndCopy ¶
func DoesHostnamesMatch ¶ added in v0.22.0
DoesHostnamesMatch returns a boolean indicating if the hostname of two different URLs are the same.
func DownloadToFile ¶
func ExecCommandWithContext ¶ added in v0.18.0
func ExecCommandWithContext(ctx context.Context, showLogs bool, commandName string, args ...string) (string, string, error)
ExecCommandWithContext executes a given command with args in the current working directory.
func ExecCommandWithContextAndDir ¶ added in v0.22.0
func ExecCommandWithContextAndDir(ctx context.Context, dir string, showLogs bool, commandName string, args ...string) (string, string, error)
ExecCommandWithContextAndDir executes a given command with args in the specified directory.
func ExecLaunchURL ¶ added in v0.22.0
func Fetch ¶
func Fetch(url string) io.ReadCloser
func FindYamlTemplates ¶ added in v0.21.0
FindYamlTemplates finds strings with a given prefix in a config.
func GetFinalExecutablePath ¶ added in v0.19.2
GetFinalExecutablePath returns the absolute path to the zarf executable, following any symlinks along the way
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 ReloadYamlTemplate ¶ added in v0.21.0
ReloadYamlTemplate marshals a given config, replaces strings and unmarshals it back.
func ReplaceTextTemplate ¶ added in v0.21.0
ReplaceTextTemplate loads a file from a given path, replaces text in it and writes it back in place
func RunPreflightChecks ¶
func RunPreflightChecks()
func Sget ¶ added in v0.18.0
Sget performs a cosign signature verification on a given image using the specified public key.
func SwapHost ¶
SwapHost Perform base url replacement and adds a crc32 of the original url to the end of the src
func SwapHostWithoutChecksum ¶ added in v0.22.0
SwapHostWithoutChecksum Perform base url replacement but avoids adding a checksum of the original url.
func ValidHostname ¶
func ValidateSha256Sum ¶
func VerifyBinary ¶
VerifyBinary returns true if binary is available