file

package
v4.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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