general

package
v1.13.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TempFolderNamePrefix = "hpvs-"

	HyperProtectOsHpvs     = "hpvs"
	HyperProtectOsHpcrRhvs = "hpcr-rhvs"
)

Variables

This section is empty.

Functions

func CertificateDownloader

func CertificateDownloader(url string) (string, error)

CertificateDownloader - function to download encryption certificate

func CheckFileFolderExists

func CheckFileFolderExists(folderFilePath string) bool

CheckFileFolderExists - function to check if file or folder exists

func CheckIfEmpty

func CheckIfEmpty(values ...interface{}) bool

CheckIfEmpty - function to check if given arguments are not empty

func CheckUrlExists

func CheckUrlExists(url string) (bool, error)

CheckUrlExists - function to check if URL exists or not

func CreateTempFile

func CreateTempFile(data string) (string, error)

CreateTempFile - function to create temp file

func DecodeBase64String

func DecodeBase64String(base64Data string) (string, error)

DecodeBase64String - function to decode base64 string

func EncodeToBase64

func EncodeToBase64(input []byte) string

EncodeToBase64 - function to encode string as base64

func ExecCommand

func ExecCommand(commandName, stdinInput string, args ...string) (string, error)

ExecCommand - function to run os commands

func FetchEncryptionCertificate

func FetchEncryptionCertificate(version, encryptionCertificate string) (string, error)

FetchEncryptionCertificate - function to get encryption certificate

func GenerateSha256

func GenerateSha256(input string) string

GenerateSha256 - function to generate SHA256 of a string

func GenerateTgzBase64

func GenerateTgzBase64(folderFilesPath []string) (string, error)

GenerateTgzBase64 - function to generate tgz and return it as base64

func GetDataFromLatestVersion

func GetDataFromLatestVersion(jsonData, version string) (string, string, error)

GetDataFromLatestVersion - function to get the value based on constraints

func GetEncryptPassWorkload

func GetEncryptPassWorkload(encryptedData string) (string, string)

GetEncryptPassWorkload - function to get encrypted password and encrypted workload from data

func GetOpenSSLPath added in v1.12.0

func GetOpenSSLPath() string

GetOpenSSLPath check if OPENSSL_BIN is set If set → returns its value If not set → defaults to "openssl"

func IsJSON

func IsJSON(str string) bool

IsJSON - function to check if input data is JSON or not

func KeyValueInjector

func KeyValueInjector(contract, key, value string) (string, error)

KeyValueInjector - function to inject key value pair in YAML

func ListFoldersAndFiles

func ListFoldersAndFiles(folderPath string) ([]string, error)

ListFoldersAndFiles - function to list files and folder under a folder

func MapToYaml

func MapToYaml(m map[string]interface{}) (string, error)

MapToYaml - function to convert string map to YAML

func ReadDataFromFile

func ReadDataFromFile(filePath string) (string, error)

ReadDataFromFile - function to read data from file

func RemoveTempFile

func RemoveTempFile(filePath string) error

RemoveTempFile - function to remove temp file

func VerifyContractWithSchema

func VerifyContractWithSchema(contract, version string) error

VerifyContractWithSchema - function to verify if contract matches schema

func VerifyNetworkSchema added in v1.13.3

func VerifyNetworkSchema(Network_Config_File string) error

VerifyNetworkSchema - function to validates a network-config YAML file

func YamlToJson

func YamlToJson(str string) (string, error)

YamlToJson - function to convert YAML to JSON

Types

type Contract added in v1.12.1

type Contract struct {
	Env               string `yaml:"env"`
	Workload          string `yaml:"workload"`
	WorkloadSignature string `yaml:"envWorkloadSignature"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL