infraHelper

package
v0.0.0-...-3be4c0f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: EPL-2.0 Imports: 16 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, virtualHost string) error
func CreateSymlink(
	sourcePath string,
	targetPath string,
	shouldOverwrite bool,
) error

func DownloadFile

func DownloadFile(url string, filePath string) error

func FileExists

func FileExists(filePath string) bool

func GenPass

func GenPass(length int) string

func GetAllRegexGroupMatches

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

func GetFileContent

func GetFileContent(filePath string) (string, error)

func GetFilePathWithMatch

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

func GetOsRelease

func GetOsRelease() (string, error)

func GetPkgLatestVersion

func GetPkgLatestVersion(pkgName string, majorVersion *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 GetRuntimeContext

func GetRuntimeContext() (valueObject.RuntimeContext, 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 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

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