Documentation
¶
Index ¶
- func AddNewStringsToStringArray(list []string, elmsToAdd ...string) []string
- func BufferedPipedWriterProcess(f func(w io.WriteCloser)) io.ReadCloser
- func Chown(path string, uid, gid *uint32) error
- func CopyArr[T any](arr []T) (ret []T)
- func CopyFileIntoTar(tw *tar.Writer, tarEntryName, filePath string) error
- func CopyGitIndexEntryIntoTar(tw *tar.Writer, tarEntryName string, entry *index.Entry, ...) error
- func CopyMap[K comparable, V any](m map[K]V) (ret map[K]V)
- func CopyTar(ctx context.Context, in io.Reader, tw *tar.Writer, opts CopyTarOptions) error
- func CreateArchive(archivePath string, f func(tw *tar.Writer) error) error
- func CreateArchiveBasedOnAnotherOne(ctx context.Context, sourceArchivePath, destinationArchivePath string, ...) error
- func DirExists(path string) (bool, error)
- func DumpYaml(v interface{}) string
- func ExcludeFromStringArray(list []string, elmsToRemove ...string) []string
- func ExecKubectlCmd(args ...string) *exec.Cmd
- func ExecWerfBinaryCmd(args ...string) *exec.Cmd
- func ExpandPath(path string) string
- func ExtractTar(tarFileReader io.Reader, dstDir string, opts ExtractTarOptions) error
- func FileExists(path string) (bool, error)
- func FilepathsWithParents(path string) []string
- func FilterSlice[V any](slice []V, filterFunc func(i int, val V) bool) []V
- func FindDuplicatedStrings(elems []string) []string
- func FirstMatchInSliceIndex[V any](slice []V, matchFunc func(i int, val V) bool) *int
- func GenerateConsistentRandomString(n int) string
- func GetAbsoluteFilepath(absOrRelPath string) string
- func GetBoolEnvironment(environmentName string) *bool
- func GetBoolEnvironmentDefaultFalse(environmentName string) bool
- func GetBoolEnvironmentDefaultTrue(environmentName string) bool
- func GetFirstExistingEnvVarAsString(envNames ...string) string
- func GetInt64EnvVar(varName string) (*int64, error)
- func GetIntEnvVar(varName string) (*int64, error)
- func GetRelativeToBaseFilepath(base, path string) string
- func GetUint64EnvVar(varName string) (*uint64, error)
- func GlobPrefixWithoutPatterns(glob string) (string, string)
- func HashContentsAndPathsRecurse(path string) (string, error)
- func InterfaceArrayToStringArray(array []interface{}) ([]string, error)
- func InterfaceToMapStringInterface(value interface{}) (map[string]interface{}, error)
- func InterfaceToStringArray(value interface{}) ([]string, error)
- func IsInContainer() bool
- func IsNotADirectoryError(err error) bool
- func IsStringsContainValue(arr []string, value string) bool
- func IsSubpathOfBasePath(basePath, path string) bool
- func LegacyMurmurHash(args ...string) string
- func LookupBoolEnvironment(environmentName string) (*bool, bool)
- func MapFuncToSlice[T, RT any, FT func(T) RT](arr []T, f FT) (res []RT)
- func MapKeys[M ~map[K]V, K comparable, V any](m M) (res []K)
- func MapLoadOrCreateMutex(m *sync.Map, key string) *sync.Mutex
- func MapMustLoad(m *sync.Map, key string) interface{}
- func MapStringInterfaceToMapStringString(value map[string]interface{}) map[string]string
- func MapValues[M ~map[K]V, K comparable, V any](m M) (res []V)
- func MergeMaps[K comparable, V any](src, dest map[K]V) map[K]V
- func NumerateLines(text string, firstLineNumber int) string
- func PredefinedValuesByEnvNamePrefix(envNamePrefix string, envNamePrefixesToExcept ...string) []string
- func RegularFileExists(path string) (bool, error)
- func RejectEmptyStrings(arr []string) []string
- func Reverse(s string) string
- func SafeTrimGlobsAndSlashesFromFilepath(p string) string
- func SafeTrimGlobsAndSlashesFromPath(p string) string
- func Sha256Hash(args ...string) string
- func Sha3_224Hash(args ...string) string
- func SortedStringKeys[T map[string]any](m T) []string
- func SplitFilepath(path string) (result []string)
- func SplitLines(s string) []string
- func ToLinuxContainerPath(path string) string
- func UniqAppendString(arr []string, value string) []string
- func UniqStrings(arr []string) []string
- func WriteDirAsTar(dir string, w io.Writer) error
- type CopyTarOptions
- type CreateArchiveOptions
- type ExtractTarOptions
- type GoroutineSafeBuffer
- func (b *GoroutineSafeBuffer) Bytes() []byte
- func (b *GoroutineSafeBuffer) Cap() int
- func (b *GoroutineSafeBuffer) Grow(n int)
- func (b *GoroutineSafeBuffer) Len() int
- func (b *GoroutineSafeBuffer) Next(n int) []byte
- func (b *GoroutineSafeBuffer) Read(p []byte) (n int, err error)
- func (b *GoroutineSafeBuffer) ReadByte() (c byte, err error)
- func (b *GoroutineSafeBuffer) ReadBytes(delim byte) (line []byte, err error)
- func (b *GoroutineSafeBuffer) ReadFrom(r io.Reader) (n int64, err error)
- func (b *GoroutineSafeBuffer) ReadRune() (r rune, size int, err error)
- func (b *GoroutineSafeBuffer) ReadString(delim byte) (line string, err error)
- func (b *GoroutineSafeBuffer) Reset()
- func (b *GoroutineSafeBuffer) String() string
- func (b *GoroutineSafeBuffer) Truncate(n int)
- func (b *GoroutineSafeBuffer) UnreadByte() error
- func (b *GoroutineSafeBuffer) UnreadRune() error
- func (b *GoroutineSafeBuffer) Write(p []byte) (n int, err error)
- func (b *GoroutineSafeBuffer) WriteByte(c byte) error
- func (b *GoroutineSafeBuffer) WriteRune(r rune) (n int, err error)
- func (b *GoroutineSafeBuffer) WriteString(s string) (n int, err error)
- func (b *GoroutineSafeBuffer) WriteTo(w io.Writer) (n int64, err error)
- type Pair
- type SerializableError
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferedPipedWriterProcess ¶
func BufferedPipedWriterProcess(f func(w io.WriteCloser)) io.ReadCloser
func CopyMap ¶
func CopyMap[K comparable, V any](m map[K]V) (ret map[K]V)
func CreateArchiveBasedOnAnotherOne ¶
func CreateArchiveBasedOnAnotherOne(ctx context.Context, sourceArchivePath, destinationArchivePath string, opts CreateArchiveOptions) error
func ExcludeFromStringArray ¶
func ExecKubectlCmd ¶
func ExecWerfBinaryCmd ¶
func ExpandPath ¶
func ExtractTar ¶
func ExtractTar(tarFileReader io.Reader, dstDir string, opts ExtractTarOptions) error
func FilepathsWithParents ¶
func FilterSlice ¶
func FindDuplicatedStrings ¶
func FirstMatchInSliceIndex ¶
Returns nil if no match.
func GetAbsoluteFilepath ¶
func GetBoolEnvironment ¶
func GetInt64EnvVar ¶
func GetIntEnvVar ¶
func GetUint64EnvVar ¶
func GlobPrefixWithoutPatterns ¶
GlobPrefixWithoutPatterns figures out how many components we don't need to glob because they're just names without patterns
func HashContentsAndPathsRecurse ¶
For file: hash contents of file with its name. For directory: hash contents of all files in directory, along with their relative filenames.
func InterfaceToStringArray ¶
func IsInContainer ¶
func IsInContainer() bool
func IsNotADirectoryError ¶
func IsStringsContainValue ¶
func IsSubpathOfBasePath ¶
func LegacyMurmurHash ¶
LegacyMurmurHash function returns a hash of non-fixed length (1-8 symbols)
func LookupBoolEnvironment ¶
func MapFuncToSlice ¶
func MapFuncToSlice[T, RT any, FT func(T) RT](arr []T, f FT) (res []RT)
func MapKeys ¶
func MapKeys[M ~map[K]V, K comparable, V any](m M) (res []K)
func MapMustLoad ¶
func MapValues ¶
func MapValues[M ~map[K]V, K comparable, V any](m M) (res []V)
func MergeMaps ¶
func MergeMaps[K comparable, V any](src, dest map[K]V) map[K]V
Dest has higher priority.
func NumerateLines ¶
func RegularFileExists ¶
func RejectEmptyStrings ¶
func SafeTrimGlobsAndSlashesFromFilepath ¶
SafeTrimGlobsAndSlashesFromFilepath trims any trailing globs and/or slashes from the path, while ignoring globs that are part of a directory or file name.
func Sha256Hash ¶
func Sha3_224Hash ¶
func SortedStringKeys ¶
func SplitFilepath ¶
func SplitLines ¶
func ToLinuxContainerPath ¶
func UniqAppendString ¶
func UniqStrings ¶
Types ¶
type CopyTarOptions ¶
type CreateArchiveOptions ¶
type CreateArchiveOptions struct { CopyTarOptions AfterCopyFunc func(tw *tar.Writer) error }
type ExtractTarOptions ¶
type ExtractTarOptions struct {
UID, GID *uint32
}
type GoroutineSafeBuffer ¶
func (*GoroutineSafeBuffer) Bytes ¶
func (b *GoroutineSafeBuffer) Bytes() []byte
func (*GoroutineSafeBuffer) Cap ¶
func (b *GoroutineSafeBuffer) Cap() int
func (*GoroutineSafeBuffer) Grow ¶
func (b *GoroutineSafeBuffer) Grow(n int)
func (*GoroutineSafeBuffer) Len ¶
func (b *GoroutineSafeBuffer) Len() int
func (*GoroutineSafeBuffer) Next ¶
func (b *GoroutineSafeBuffer) Next(n int) []byte
func (*GoroutineSafeBuffer) ReadByte ¶
func (b *GoroutineSafeBuffer) ReadByte() (c byte, err error)
func (*GoroutineSafeBuffer) ReadBytes ¶
func (b *GoroutineSafeBuffer) ReadBytes(delim byte) (line []byte, err error)
func (*GoroutineSafeBuffer) ReadFrom ¶
func (b *GoroutineSafeBuffer) ReadFrom(r io.Reader) (n int64, err error)
func (*GoroutineSafeBuffer) ReadRune ¶
func (b *GoroutineSafeBuffer) ReadRune() (r rune, size int, err error)
func (*GoroutineSafeBuffer) ReadString ¶
func (b *GoroutineSafeBuffer) ReadString(delim byte) (line string, err error)
func (*GoroutineSafeBuffer) Reset ¶
func (b *GoroutineSafeBuffer) Reset()
func (*GoroutineSafeBuffer) String ¶
func (b *GoroutineSafeBuffer) String() string
func (*GoroutineSafeBuffer) Truncate ¶
func (b *GoroutineSafeBuffer) Truncate(n int)
func (*GoroutineSafeBuffer) UnreadByte ¶
func (b *GoroutineSafeBuffer) UnreadByte() error
func (*GoroutineSafeBuffer) UnreadRune ¶
func (b *GoroutineSafeBuffer) UnreadRune() error
func (*GoroutineSafeBuffer) Write ¶
func (b *GoroutineSafeBuffer) Write(p []byte) (n int, err error)
func (*GoroutineSafeBuffer) WriteByte ¶
func (b *GoroutineSafeBuffer) WriteByte(c byte) error
func (*GoroutineSafeBuffer) WriteRune ¶
func (b *GoroutineSafeBuffer) WriteRune(r rune) (n int, err error)
func (*GoroutineSafeBuffer) WriteString ¶
func (b *GoroutineSafeBuffer) WriteString(s string) (n int, err error)
type SerializableError ¶
type SerializableError struct {
Error error
}
func (SerializableError) MarshalJSON ¶
func (obj SerializableError) MarshalJSON() ([]byte, error)
func (*SerializableError) UnmarshalJSON ¶
func (obj *SerializableError) UnmarshalJSON(data []byte) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.