{"modulePath":"github.com/GoogleContainerTools/container-diff","version":"v0.19.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\n## Functions\n\n```go\nfunc BuildTransport(registry Registry) http.RoundTripper\n```\n\n```go\nfunc CheckSameFile(f1name, f2name string) (bool, error)\n```\n\n```go\nfunc CheckSameSymlink(f1name, f2name string) (bool, error)\n```\n\n```go\nfunc CheckTar(image string) bool\n```\n\n```go\nfunc CleanFilePath(dirtyPath string) string\n```\nCleanFilePath removes characters from a given path that cannot be used in paths by the underlying platform (e.g. Windows)\n\n```go\nfunc CleanupImage(image Image)\n```\n\n```go\nfunc ConfigureTLS(skipTsVerifyRegistries []string, registriesToCertificates map[string]string)\n```\n\n```go\nfunc DirIsEmpty(path string) (bool, error)\n```\ngiven a path to a directory, check if it has any contents\n\n```go\nfunc GetFileContents(path string) (*string, error)\n```\nGetFileContents returns the contents of a file at the specified path\n\n```go\nfunc GetFileSystemForImage(image v1.Image, root string, whitelist []string) error\n```\nunpack image filesystem to local disk if provided directory is not empty, do nothing\n\n```go\nfunc GetFileSystemForLayer(layer v1.Layer, root string, whitelist []string) error\n```\nGetFileSystemForLayer unpacks a layer to local disk\n\n```go\nfunc GetImageLayers(pathToImage string) []string\n```\n\n```go\nfunc GetSize(path string) int64\n```\n\n```go\nfunc HasFilepathPrefix(path, prefix string) bool\n```\nHasFilepathPrefix checks if the given file path begins with prefix\n\n```go\nfunc HasTag(image string) bool\n```\nchecks to see if an image string contains a tag.\n\n```go\nfunc IsTar(path string) bool\n```\n\n```go\nfunc RemoveTag(image string) string\n```\nreturns a raw image name with the tag removed\n\n```go\nfunc SortMap(m map[string]string) string\n```\n\n## Types\n\n```go\ntype Directory struct {\n\tRoot    string\n\tContent []string\n}\n```\nDirectory stores a representation of a file directory.\n\n```go\nfunc GetDirectory(path string, deep bool) (Directory, error)\n```\nGetDirectoryContents converts the directory starting at the provided path into a Directory struct.\n\n```go\ntype DirectoryEntry struct {\n\tName string\n\tSize int64\n}\n```\n\n```go\nfunc CreateDirectoryEntries(root string, entryNames []string) (entries []DirectoryEntry)\n```\n\n```go\nfunc GetDirectoryEntries(d Directory) []DirectoryEntry\n```\n\n```go\ntype Image struct {\n\tImage  v1.Image\n\tSource string\n\tFSPath string\n\tDigest v1.Hash\n\tLayers []Layer\n}\n```\n\n```go\nfunc GetImage(imageName string, includeLayers bool, cacheDir string) (Image, error)\n```\nGetImage infers the source of an image and retrieves a v1.Image reference to it. Once a reference is obtained, it attempts to unpack the v1.Image's reader's contents into a temp directory on the local filesystem.\n\n```go\nfunc GetImageForName(imageName string) (Image, error)\n```\nGetImageForName retrieves an image by name alone. It does not return layer information, or respect caching.\n\n```go\ntype ImageHistoryItem struct {\n\tCreatedBy string `json:\"created_by\"`\n}\n```\n\n```go\ntype Layer struct {\n\tFSPath string\n\tDigest v1.Hash\n}\n```\n\n```go\ntype OriginalPerm struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype TestImage struct {\n\tConfig *v1.ConfigFile\n}\n```\n\n```go\nfunc (i *TestImage) BlobSet() (map[v1.Hash]struct{}, error)\n```\n\n```go\nfunc (i *TestImage) ConfigFile() (*v1.ConfigFile, error)\n```\n\n```go\nfunc (i *TestImage) ConfigName() (v1.Hash, error)\n```\n\n```go\nfunc (i *TestImage) Digest() (v1.Hash, error)\n```\n\n```go\nfunc (i *TestImage) LayerByDiffID(diffID v1.Hash) (v1.Layer, error)\n```\n\n```go\nfunc (i *TestImage) LayerByDigest(v1.Hash) (v1.Layer, error)\n```\n\n```go\nfunc (i *TestImage) Layers() ([]v1.Layer, error)\n```\n\n```go\nfunc (i *TestImage) Manifest() (*v1.Manifest, error)\n```\n\n```go\nfunc (i *TestImage) MediaType() (types.MediaType, error)\n```\n\n```go\nfunc (i *TestImage) RawConfigFile() ([]byte, error)\n```\n\n```go\nfunc (i *TestImage) RawManifest() ([]byte, error)\n```\n\n```go\nfunc (i *TestImage) Size() (int64, error)\n```\n\n","path":"github.com/GoogleContainerTools/container-diff/pkg/util","name":"util","synopsis":"","isRedistributable":true}
