Documentation ¶
Index ¶
- Constants
- func Contains[T comparable](list []T, val T) bool
- func ContainsAll(str string, terms []string) bool
- func ContainsAny(str string, terms []string) bool
- func FileExists(path string) (bool, error)
- func GetArchAliases() []string
- func GetFedoraGPGKeys() (io.ReadCloser, error)
- func GetLineInFileMatchingKey(filepath string, key string) (res string, err error)
- func GetLineInReader(reader io.Reader, match string) (res string, err error)
- func GetOSAliases() []string
- func Keys[T, U comparable](myMap map[T]U) []T
- func Sha256sum(filepath string) (string, error)
- func Unarchive(source string, destination string) error
- func Unzip(source string, destination string) error
- func VerifyGPGSignature(targetFilePath, signatureFilePath string) error
- func WriteFile(from io.Reader, to string, permissions os.FileMode) error
Constants ¶
const FedoraSigningKeyURL string = "https://fedoraproject.org/fedora.gpg"
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](list []T, val T) bool
Contains returns true if the provided list has a matching element
func ContainsAll ¶ added in v1.0.0
ContainsAll returns true if all of the provided search terms are a substring of 'str'
func ContainsAny ¶ added in v1.0.0
ContainsAny returns true if any of the provided search terms are a substring of 'str'
func FileExists ¶ added in v0.1.0
FileExists checks if a file *of any type* is present at the given path
func GetArchAliases ¶ added in v1.0.0
func GetArchAliases() []string
GetArchAliases returns all commonly used names for the system's architecture. ie - An 'amd64' system is functionally equivalent to 'x86_64' for our purposes
func GetFedoraGPGKeys ¶ added in v1.0.0
func GetFedoraGPGKeys() (io.ReadCloser, error)
func GetLineInFileMatchingKey ¶ added in v0.2.0
GetLineInFileMatchingKey searches the provided file for a line that contains the provided key. A key is a pattern that will be either at the begin/end of line and will have ::spaces:: characters around. If a match is found, the entire line is returned. Only the first result is returned. If no lines match, an error is returned
func GetLineInReader ¶ added in v0.1.0
GetLinInReader searches the provided reader for a line that contains the provided string. If a match is found, the entire line is returned. Only the first result is returned. If no lines match, an error is returned
func GetOSAliases ¶ added in v1.0.0
func GetOSAliases() []string
GetOSAliases returns all commonly used names for the system's OS. ie - A system running 'darwin' is functionally equivalent to 'mac' for our purposes
func Keys ¶
func Keys[T, U comparable](myMap map[T]U) []T
Keys returns a slice containing the keys of the provided map. Order is preserved
func Unarchive ¶
Unarchive decompresses and extracts the contents of .tar.gz bundles to the specified destination
func VerifyGPGSignature ¶ added in v1.0.0
Types ¶
This section is empty.