Documentation ¶
Index ¶
- Variables
- func CheckRPM(rpm string) error
- func CopyFile(dest string, src string) error
- func CreateCertTemplate() *x509.Certificate
- func CreateKeyPair() (*rsa.PrivateKey, error)
- func Download(filename string, url string) (err error)
- func GenerateCertificate(cert string, template, parent *x509.Certificate, pubkey interface{}, ...) error
- func GetDirContents(dirname string) []os.FileInfo
- func GetIncludedBundles(filename string) ([]string, error)
- func Git(args ...string)
- func PrintError(e error)
- func ReadFileAndSplit(filename string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
var (
// ENOVERSION is returned when an a version is unknown
ENOVERSION = 24
)
Functions ¶
func CheckRPM ¶
CheckRPM returns nil if file <name>.rpm shows a valid RPM v# output, in order to catch corrupt or invalid RPM files.
func CopyFile ¶
CopyFile is used during the build process to copy a given file to the target instead of dealing with the particulars of hardlinking.
func CreateCertTemplate ¶
func CreateCertTemplate() *x509.Certificate
CreateCertTemplate will construct the template for needed openssl metadata instead of using an attributes.cnf file
func CreateKeyPair ¶
func CreateKeyPair() (*rsa.PrivateKey, error)
CreateKeyPair constructs an RSA keypair in memory
func GenerateCertificate ¶
func GenerateCertificate(cert string, template, parent *x509.Certificate, pubkey interface{}, privkey interface{}) error
GenerateCertificate will create the private signing key and public certificate for clients to use and writes them to disk
func GetDirContents ¶
GetDirContents is an an assert-style helper to get the contents of a directory, or to exit on failure.
func GetIncludedBundles ¶
GetIncludedBundles parses a bundle definition file and returns a list of all bundles it includes.
func Git ¶
func Git(args ...string)
Git runs git with arguments and exits in case of failure. IMPORTANT: the 'args' passed to this function _must_ be validated, as to avoid cases where input is received from a third party source. Such inputs could be something the likes of 'status; rm -rf .*' and need to be escaped or avoided properly.
func PrintError ¶
func PrintError(e error)
PrintError is a utility function to emit an error to the console
func ReadFileAndSplit ¶
ReadFileAndSplit tokenizes the given file and converts in into a slice split by the newline character.
Types ¶
This section is empty.