utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExistAndHasContent

func DirExistAndHasContent(dirPath string) error

func DirHasContentWithCertainExtension added in v1.2.0

func DirHasContentWithCertainExtension(dirPath string, extensions []string) error

func EscapeValues added in v1.2.0

func EscapeValues(value string) string

func FileHasExtension added in v1.3.0

func FileHasExtension(filePath, extension string) error

func GenerateRandomName

func GenerateRandomName(retry int) string

func GenerateRandomString

func GenerateRandomString(opt RandomStringOptions) string

func GetSSHAuthSock added in v1.2.0

func GetSSHAuthSock() string

func GetSSHGitSecureConnectCommand added in v1.2.0

func GetSSHGitSecureConnectCommand() string

GetSSHGitSecureConnectCommand returns an SSH command string configured for secure connections by bypassing the usual host key storage mechanism. It's particularly useful for Git operations over SSH in environments where strict host key verification needs to be relaxed, such as automated scripts or continuous integration systems connecting to dynamically changing servers. This command automatically accepts new host keys but prevents connections to hosts with changed keys, mitigating man-in-the-middle attacks without requiring manual intervention for known host key management.

func GetUUID

func GetUUID() string

func IsValidDirE added in v1.2.0

func IsValidDirE(path string) error

func IsValidFileE added in v1.3.0

func IsValidFileE(filePath string) error

func MergeMaps added in v1.2.0

func MergeMaps(maps ...map[string]string) map[string]string

func MergeSlices added in v1.2.0

func MergeSlices(slices ...[]string) []string

func RemoveDoubleQuotes

func RemoveDoubleQuotes(target string) string

Types

type RandomStringOptions

type RandomStringOptions struct {
	Length            int
	AllowSpecialChars bool
	UpperLowerRandom  bool
}

Jump to

Keyboard shortcuts

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