file

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GZipImplEnvVarKey = "GZIP_IMPLEMENTATION"
	GZIP              = "GZip"
	PGZIP             = "PGZip"
)

Variables

This section is empty.

Functions

func CompressContent

func CompressContent(ctx context.Context, content []byte) []byte

CompressContent will compress the byte array using zip writer

func CompressEncodeString

func CompressEncodeString(ctx context.Context, content string) string

CompressEncodeString will return the compressed string with base64 encoded

func DecodeDecompressString

func DecodeDecompressString(ctx context.Context, content string) (string, error)

DecodeDecompressString will return decode and decompress the

func DecompressContent

func DecompressContent(ctx context.Context, content []byte) ([]byte, error)

DecompressContent will return the uncompressed content

func Exists

func Exists(path string) bool

Exists returns whether or not a path exists

func ExistsInTar

func ExistsInTar(sourcePath string, tarReader TarReader) bool

ExistsInTar return true if file or directory exists in tar

func GetGzipReader

func GetGzipReader(reader io.Reader) (io.ReadCloser, error)

GetGzipReader gets the GzipReader based on `GZipImplEnvVarKey` environment variable.

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory returns whether or not the given file is a directory

func WalkManifests

func WalkManifests(ctx context.Context, root string, fn func(path string, data []byte) error) error

WalkManifests is based on filepath.Walk but will only walk through Kubernetes manifests

Types

type TarReader

type TarReader interface {
	Next() (*tar.Header, error)
}

Jump to

Keyboard shortcuts

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