infraHelper

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: EPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(srcPath string, dstPath string) error

func CreateSelfSignedSsl

func CreateSelfSignedSsl(
	dirPath string,
	vhostName string,
	aliasesHostname []string,
) error
func CreateSymlink(sourcePath string, targetPath string, shouldOverwrite bool) error

func DecryptStr added in v0.1.2

func DecryptStr(
	secretKey, encryptedText string,
) (decryptedText string, err error)

func DnsLookup

func DnsLookup(recordName string, recordType *string) ([]string, error)

func DownloadFile

func DownloadFile(url string, filePath string) error

func EncryptStr added in v0.1.2

func EncryptStr(
	secretKey, plainText string,
) (encryptedText string, err error)

func FileExists

func FileExists(filePath string) bool

func FileSerializedDataToMap added in v0.1.5

func FileSerializedDataToMap(
	filePath valueObject.UnixFilePath,
) (outputMap map[string]interface{}, err error)

func GenPass

func GenPass(length int) string

func GenStrongHash

func GenStrongHash(value string) string

func GenStrongShortHash

func GenStrongShortHash(value string) string

func GenWeakHash

func GenWeakHash(value string) string

func GetAllRegexGroupMatches

func GetAllRegexGroupMatches(input string, regexExpression string) []string

func GetFileContent

func GetFileContent(filePath string) (string, error)

func GetFilePathWithMatch

func GetFilePathWithMatch(dir string, partialMatch string) (string, error)

func GetPrimaryVirtualHost

func GetPrimaryVirtualHost() (valueObject.Fqdn, error)

func GetRegexCapturingGroups

func GetRegexCapturingGroups(input string, regex string) map[string]string

func GetRootDomain

func GetRootDomain(hostname valueObject.Fqdn) (valueObject.Fqdn, error)

func InstallPkgs

func InstallPkgs(packages []string) error

func IsPrimaryVirtualHost

func IsPrimaryVirtualHost(vhost valueObject.Fqdn) bool
func IsSymlink(sourcePath string) bool

func IsSymlinkTo

func IsSymlinkTo(sourcePath string, targetPath string) bool

func MakeDir

func MakeDir(dirPath string) error

func ReadServerPublicIpAddress

func ReadServerPublicIpAddress() (ipAddress valueObject.IpAddress, err error)

func ReloadWebServer

func ReloadWebServer() error
func RemoveSymlink(symlinkPath string) error

func RunCmd

func RunCmd(command string, args ...string) (string, error)

func RunCmdWithSubShell

func RunCmdWithSubShell(command string) (string, error)

func UpdateFile

func UpdateFile(filePath string, content string, shouldOverwrite bool) error

func UpdatePermissionsForWebServerUse

func UpdatePermissionsForWebServerUse(
	filePath string, isRecursive bool, shouldIncludeSymlink bool,
) error

func ValidateWebServerConfig

func ValidateWebServerConfig() error

Types

type CommandError

type CommandError struct {
	StdErr   string `json:"stdErr"`
	ExitCode int    `json:"exitCode"`
}

func (*CommandError) Error

func (e *CommandError) Error() string

Jump to

Keyboard shortcuts

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