Documentation
¶
Index ¶
- Variables
- func CIDConfigDir() string
- func CIDStateDir() string
- func CITempDir(serviceSlug string) (string, error)
- func CloneMap[K comparable, V any](src map[K]V) map[K]V
- func CompactAndSort(data []string) []string
- func DirectorySetup()
- func ExportMachineCACertsToFile(target string) error
- func FirstNonEmpty(strings []string) string
- func GetCertFileByType(certFileType string) (string, error)
- func GetContainerUser() string
- func GetCurrentUser() user.User
- func GetStringOrDefault(value string, defaultValue string) string
- func MergeMaps(maps ...map[string]string) map[string]string
- func RandomUUIDWithoutDashes() string
- func RegexFormat(input string, regexExpr string, outputTemplate string) (string, error)
- func ResolveEnvMap(env map[string]string) map[string]string
- func ResolveEnvPlaceholders(value string, env map[string]string) string
- func StructToJsonFile(registry interface{}, file string) error
- func ToSemanticVersion(version string) string
- func TrimLeftEachLine(s string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToReadBundleFile = errors.New("failed to read bundle file") ErrNoCertBundleFound = errors.New("no ca bundle found") ErrFailedToCreateCertDir = errors.New("failed to create cert dir") ErrFailedToWriteCertFile = errors.New("failed to write cert file") ErrUnknownCertFileType = errors.New("unknown cert file type") )
View Source
var CaBundles = [][]string{
{"/etc/ssl/certs/ca-certificates.crt"},
{"/etc/pki/tls/certs/ca-bundle.crt", "/etc/pki/tls/certs/ca-extra.crt"},
{"/etc/ssl/ca-bundle.pem"},
{"/etc/pki/tls/cacert.pem"},
{"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"},
{"/etc/ssl/cert.pem"},
}
CaBundles paths on various systems, see https://go.dev/src/crypto/x509/root_linux.go
Functions ¶
func CIDConfigDir ¶
func CIDConfigDir() string
func CIDStateDir ¶
func CIDStateDir() string
func CITempDir ¶ added in v0.6.0
CITempDir returns a temp directory path for the given ci service slug.
func CloneMap ¶ added in v0.6.0
func CloneMap[K comparable, V any](src map[K]V) map[K]V
CloneMap returns a shallow copy of a map[K]V.
func CompactAndSort ¶ added in v0.6.0
CompactAndSort will compact and sort the given slice of strings
func DirectorySetup ¶ added in v0.6.0
func DirectorySetup()
func ExportMachineCACertsToFile ¶
ExportMachineCACertsToFile exports the machine CA certificates to a file
func FirstNonEmpty ¶ added in v0.6.0
func GetCertFileByType ¶
GetCertFileByType returns the cert file by type (ca-bundle, java-keystore)
func GetContainerUser ¶
func GetContainerUser() string
GetContainerUser returns the user id and group id of the current user to mirror it in the container
func GetCurrentUser ¶ added in v0.6.0
func GetStringOrDefault ¶
func RandomUUIDWithoutDashes ¶
func RandomUUIDWithoutDashes() string
func RegexFormat ¶
RegexFormat will evaluate a regex expr to render a template
func ResolveEnvPlaceholders ¶ added in v0.6.0
func StructToJsonFile ¶ added in v0.6.0
func ToSemanticVersion ¶ added in v0.6.0
ToSemanticVersion converts a version string to a semantic version string.
func TrimLeftEachLine ¶ added in v0.6.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.