{"modulePath":"github.com/GoogleContainerTools/container-diff","version":"v0.19.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\n## Constants\n\n```go\nconst FSDiffOutput = `\n-----{{.DiffType}}-----\n\nThese entries have been added to {{.Image2}}:{{if not .Diff.Adds}} None{{else}}\nFILE\tSIZE{{range .Diff.Adds}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}{{end}}\n\nThese entries have been deleted from {{.Image2}}:{{if not .Diff.Dels}} None{{else}}\nFILE\tSIZE{{range .Diff.Dels}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}{{end}}\n\nThese entries have been changed between {{.Image1}} and {{.Image2}}:{{if not .Diff.Mods}} None{{else}}\nFILE\tSIZE1\tSIZE2{{range .Diff.Mods}}{{\"\\n\"}}{{.Name}}\t{{.Size1}}\t{{.Size2}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst FSLayerDiffOutput = `\n-----{{.DiffType}}-----\n\n{{range $index, $diff := .Diff}}\n\nDiff for Layer {{$index}}:\nThese entries have been added to {{$.Image1}}:{{if not $diff.Adds}} None{{else}}\nFILE\tSIZE{{range $diff.Adds}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}{{end}}\n\nThese entries have been deleted from {{$.Image1}}:{{if not $diff.Dels}} None{{else}}\nFILE\tSIZE{{range $diff.Dels}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}{{end}}\n\nThese entries have been changed between {{$.Image1}} and {{$.Image2}}:{{if not $diff.Mods}} None{{else}}\nFILE\tSIZE1\tSIZE2{{range $diff.Mods}}{{\"\\n\"}}{{.Name}}\t{{.Size1}}\t{{.Size2}}{{end}}\n{{end}}\n{{end}}\n`\n```\n\n```go\nconst FileAnalysisOutput = `\n-----{{.AnalyzeType}}-----\n\nAnalysis for {{.Image}}:{{if not .Analysis}} None{{else}}\nFILE\tSIZE{{range .Analysis}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst FileLayerAnalysisOutput = `\n-----{{.AnalyzeType}}-----\n{{range $index, $analysis := .Analysis}}\n\nAnalysis for {{$.Image}} Layer {{$index}}:{{if not $analysis}} None{{else}}\nFILE\tSIZE{{range $analysis}}{{\"\\n\"}}{{.Name}}\t{{.Size}}{{end}}\n{{end}}\n{{end}}\n`\n```\n\n```go\nconst FilenameDiffOutput = `\n-----Diff of {{.Filename}}-----\n{{.Description}}\n\n{{.Diff}}\n`\n```\n\n```go\nconst HistoryDiffOutput = `\n-----{{.DiffType}}-----\n\nDocker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block \"list\" .Diff.Dels}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n\nDocker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block \"list2\" .Diff.Adds}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n`\n```\n\n```go\nconst ListAnalysisOutput = `\n-----{{.AnalyzeType}}-----\n\nAnalysis for {{.Image}}:{{if not .Analysis}} None{{else}}{{block \"list\" .Analysis}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n`\n```\n\n```go\nconst MetadataDiffOutput = `\n-----{{.DiffType}}-----\n\nImage metadata differences between {{.Image1}} and {{.Image2}}:\n\n{{.Image1}}{{if not .Diff.Adds}} None{{else}}{{block \"list\" .Diff.Adds}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n\n{{.Image2}}{{if not .Diff.Dels}} None{{else}}{{block \"list2\" .Diff.Dels}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n`\n```\n\n```go\nconst MultiVersionDiffOutput = `\n-----{{.DiffType}}-----\n\nPackages found only in {{.Image1}}:{{if not .Diff.Packages1}} None{{else}}\nNAME\tVERSION\tSIZE{{range .Diff.Packages1}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n\nPackages found only in {{.Image2}}:{{if not .Diff.Packages2}} None{{else}}\nNAME\tVERSION\tSIZE{{range .Diff.Packages2}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n\nVersion differences:{{if not .Diff.InfoDiff}} None{{else}}\nPACKAGE\tIMAGE1 ({{.Image1}})\tIMAGE2 ({{.Image2}}){{range .Diff.InfoDiff}}{{\"\\n\"}}{{print \"-\"}}{{.Package}}\t{{range .Info1}}{{.Version}}, {{.Size}}{{end}}\t{{range .Info2}}{{.Version}}, {{.Size}}{{end}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst MultiVersionPackageOutput = `\n-----{{.AnalyzeType}}-----\n\nPackages found in {{.Image}}:{{if not .Analysis}} None{{else}}\nNAME\tVERSION\tSIZE\tINSTALLATION{{range .Analysis}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}\t{{.Path}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SingleVersionDiffOutput = `\n-----{{.DiffType}}-----\n\nPackages found only in {{.Image1}}:{{if not .Diff.Packages1}} None{{else}}\nNAME\tVERSION\tSIZE{{range .Diff.Packages1}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n\nPackages found only in {{.Image2}}:{{if not .Diff.Packages2}} None{{else}}\nNAME\tVERSION\tSIZE{{range .Diff.Packages2}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n\nVersion differences:{{if not .Diff.InfoDiff}} None{{else}}\nPACKAGE\tIMAGE1 ({{.Image1}})\tIMAGE2 ({{.Image2}}){{range .Diff.InfoDiff}}{{\"\\n\"}}{{print \"-\"}}{{.Package}}\t{{.Info1.Version}}, {{.Info1.Size}}\t{{.Info2.Version}}, {{.Info2.Size}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SingleVersionPackageLayerOutput = `\n-----{{.AnalyzeType}}-----\n{{range $index, $analysis := .Analysis}}\nFor Layer {{$index}}:{{if not (or (or $analysis.Packages1 $analysis.Packages2) $analysis.InfoDiff)}} No package changes {{else}}\n{{if ne $index 0}}Deleted packages from previous layers:{{if not $analysis.Packages1}} None{{else}}\nNAME\tVERSION\tSIZE{{range $analysis.Packages1}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n\n{{end}}Packages added in this layer:{{if not $analysis.Packages2}} None{{else}}\nNAME\tVERSION\tSIZE{{range $analysis.Packages2}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}{{end}}\n{{if ne $index 0}}\nVersion differences:{{if not $analysis.InfoDiff}} None{{else}}\nPACKAGE\tPREV_LAYER\tCURRENT_LAYER {{range $analysis.InfoDiff}}{{\"\\n\"}}{{print \"-\"}}{{.Package}}\t{{.Info1.Version}}, {{.Info1.Size}}\t{{.Info2.Version}}, {{.Info2.Size}}{{end}}\n{{end}}{{end}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SingleVersionPackageOutput = `\n-----{{.AnalyzeType}}-----\n\nPackages found in {{.Image}}:{{if not .Analysis}} None{{else}}\nNAME\tVERSION\tSIZE{{range .Analysis}}{{\"\\n\"}}{{print \"-\"}}{{.Name}}\t{{.Version}}\t{{.Size}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SizeAnalysisOutput = `\n-----{{.AnalyzeType}}-----\n\nAnalysis for {{.Image}}:{{if not .Analysis}} None{{else}}\nIMAGE\tDIGEST\tSIZE{{range .Analysis}}{{\"\\n\"}}{{.Name}}\t{{.Digest}}\t{{.Size}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SizeDiffOutput = `\n-----{{.DiffType}}-----\n\nImage size difference between {{.Image1}} and {{.Image2}}:{{if not .Diff}} None{{else}}\nSIZE1\tSIZE2{{range .Diff}}{{\"\\n\"}}{{.Size1}}\t{{.Size2}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SizeLayerAnalysisOutput = `\n-----{{.AnalyzeType}}-----\n\nAnalysis for {{.Image}}:{{if not .Analysis}} None{{else}}\nLAYER\tDIGEST\tSIZE{{range .Analysis}}{{\"\\n\"}}{{.Name}}\t{{.Digest}}\t{{.Size}}{{end}}\n{{end}}\n`\n```\n\n```go\nconst SizeLayerDiffOutput = `\n-----{{.DiffType}}-----\n\nLayer size differences between {{.Image1}} and {{.Image2}}:{{if not .Diff}} None{{else}}\nLAYER\tSIZE1\tSIZE2{{range .Diff}}{{\"\\n\"}}{{.Name}}\t{{.Size1}}\t{{.Size2}}{{end}}\n{{end}}\n`\n```\n\n## Variables\n\n```go\nvar SortSize bool\n```\n\n## Functions\n\n```go\nfunc BuildLayerTargets(path, target string) ([]string, error)\n```\nBuildLayerTargets creates a string slice of the layers found at path with the target concatenated.\n\n```go\nfunc GetAddedEntries(d1, d2 pkgutil.Directory) []string\n```\n\n```go\nfunc GetAdditions(a, b []string) []string\n```\nModification of difflib's unified differ\n\n```go\nfunc GetDeletedEntries(d1, d2 pkgutil.Directory) []string\n```\n\n```go\nfunc GetDeletions(a, b []string) []string\n```\n\n```go\nfunc GetMatches(a, b []string) []string\n```\n\n```go\nfunc GetModifiedEntries(d1, d2 pkgutil.Directory) []string\n```\nChecks for content differences between files of the same name from different directories\n\n```go\nfunc JSONify(writer io.Writer, diff interface{}) error\n```\n\n```go\nfunc TemplateOutput(writer io.Writer, diff interface{}, templateType string) error\n```\n\n```go\nfunc TemplateOutputFromFormat(writer io.Writer, diff interface{}, templateType string, format string) error\n```\n\n## Types\n\n```go\ntype AnalyzeResult struct {\n\tImage       string\n\tAnalyzeType string\n\tAnalysis    interface{}\n}\n```\n\n```go\ntype DiffResult struct {\n\tImage1   string\n\tImage2   string\n\tDiffType string\n\tDiff     interface{}\n}\n```\n\n```go\ntype DirDiff struct {\n\tAdds []pkgutil.DirectoryEntry\n\tDels []pkgutil.DirectoryEntry\n\tMods []EntryDiff\n}\n```\n\n```go\nfunc DiffDirectory(d1, d2 pkgutil.Directory) (DirDiff, bool)\n```\nDiffDirectory takes the diff of two directories, assuming both are completely unpacked\n\n```go\ntype DirDiffResult DiffResult\n```\n\n```go\nfunc (r DirDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r DirDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype EntryDiff struct {\n\tName  string\n\tSize1 int64\n\tSize2 int64\n}\n```\n\n```go\ntype FileAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r FileAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r FileAnalyzeResult) OutputText(writer io.Writer, analyzeType string, format string) error\n```\n\n```go\ntype FileLayerAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r FileLayerAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r FileLayerAnalyzeResult) OutputText(writer io.Writer, analyzeType string, format string) error\n```\n\n```go\ntype FileNameDiff struct {\n\tFilename    string\n\tDescription string\n\tDiff        string\n}\n```\n\n```go\nfunc DiffFile(image1, image2 *pkgutil.Image, filename string) (*FileNameDiff, error)\n```\n\n```go\ntype HistDiffResult DiffResult\n```\n\n```go\nfunc (r HistDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r HistDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype Info struct {\n\tPackage string\n\tInfo1   PackageInfo\n\tInfo2   PackageInfo\n}\n```\nInfo stores the information for one package in two different images.\n\n```go\ntype ListAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r ListAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r ListAnalyzeResult) OutputText(writer io.Writer, resultType string, format string) error\n```\n\n```go\ntype MetadataDiffResult DiffResult\n```\n\n```go\nfunc (r MetadataDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r MetadataDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype MultiVersionInfo struct {\n\tPackage string\n\tInfo1   []PackageInfo\n\tInfo2   []PackageInfo\n}\n```\nMultiVersionInfo stores the information for one multi-version package in two different images.\n\n```go\ntype MultiVersionPackageAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r MultiVersionPackageAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r MultiVersionPackageAnalyzeResult) OutputText(writer io.Writer, resultType string, format string) error\n```\n\n```go\ntype MultiVersionPackageDiff struct {\n\tPackages1 map[string]map[string]PackageInfo\n\tPackages2 map[string]map[string]PackageInfo\n\tInfoDiff  []MultiVersionInfo\n}\n```\nMultiVersionPackageDiff stores the difference information between two images which could have multi-version packages.\n\n```go\nfunc GetMultiVersionMapDiff(map1, map2 map[string]map[string]PackageInfo) MultiVersionPackageDiff\n```\nGetMultiVersionMapDiff determines the differences between two image package maps with multi-version packages This getter supports multi version packages.\n\n```go\ntype MultiVersionPackageDiffResult DiffResult\n```\n\n```go\nfunc (r MultiVersionPackageDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r MultiVersionPackageDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype MultipleDirDiff struct {\n\tDirDiffs []DirDiff\n}\n```\n\n```go\ntype MultipleDirDiffResult DiffResult\n```\n\n```go\nfunc (r MultipleDirDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r MultipleDirDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype PackageDiff struct {\n\tPackages1 map[string]PackageInfo\n\tPackages2 map[string]PackageInfo\n\tInfoDiff  []Info\n}\n```\nPackageDiff stores the difference information between two images.\n\n```go\nfunc GetMapDiff(map1, map2 map[string]PackageInfo) PackageDiff\n```\nGetMapDiff determines the differences between maps of package names to PackageInfo structs This getter supports only single version packages.\n\n```go\ntype PackageInfo struct {\n\tVersion string\n\tSize    int64\n}\n```\nPackageInfo stores the specific metadata about a package.\n\n```go\ntype PackageLayerDiff struct {\n\tPackageDiffs []PackageDiff\n}\n```\nPackageLayerDiff stores the difference information between two images layer by layer in PackageDiff array\n\n```go\ntype PackageOutput struct {\n\tName    string\n\tPath    string `json:\",omitempty\"`\n\tVersion string\n\tSize    int64\n}\n```\n\n```go\ntype Result interface {\n\tOutputStruct() interface{}\n\tOutputText(writer io.Writer, resultType string, format string) error\n}\n```\n\n```go\ntype SingleVersionPackageAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r SingleVersionPackageAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SingleVersionPackageAnalyzeResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype SingleVersionPackageDiffResult DiffResult\n```\n\n```go\nfunc (r SingleVersionPackageDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SingleVersionPackageDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype SingleVersionPackageLayerAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r SingleVersionPackageLayerAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SingleVersionPackageLayerAnalyzeResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype SingleVersionPackageLayerDiffResult DiffResult\n```\n\n```go\nfunc (r SingleVersionPackageLayerDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SingleVersionPackageLayerDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype SizeAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r SizeAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SizeAnalyzeResult) OutputText(writer io.Writer, analyzeType string, format string) error\n```\n\n```go\ntype SizeDiff struct {\n\tName  string\n\tSize1 int64\n\tSize2 int64\n}\n```\n\n```go\ntype SizeDiffResult DiffResult\n```\n\n```go\nfunc (r SizeDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SizeDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype SizeEntry struct {\n\tName   string\n\tDigest v1.Hash\n\tSize   int64\n}\n```\n\n```go\ntype SizeLayerAnalyzeResult AnalyzeResult\n```\n\n```go\nfunc (r SizeLayerAnalyzeResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SizeLayerAnalyzeResult) OutputText(writer io.Writer, analyzeType string, format string) error\n```\n\n```go\ntype SizeLayerDiffResult DiffResult\n```\n\n```go\nfunc (r SizeLayerDiffResult) OutputStruct() interface{}\n```\n\n```go\nfunc (r SizeLayerDiffResult) OutputText(writer io.Writer, diffType string, format string) error\n```\n\n```go\ntype StrDirectoryEntry struct {\n\tName string\n\tSize string\n}\n```\n\n```go\ntype StrEntryDiff struct {\n\tName  string\n\tSize1 string\n\tSize2 string\n}\n```\n\n```go\ntype StrInfo struct {\n\tPackage string\n\tInfo1   StrPackageInfo\n\tInfo2   StrPackageInfo\n}\n```\n\n```go\ntype StrMultiVersionInfo struct {\n\tPackage string\n\tInfo1   []StrPackageInfo\n\tInfo2   []StrPackageInfo\n}\n```\n\n```go\ntype StrPackageInfo struct {\n\tVersion string\n\tSize    string\n}\n```\n\n```go\ntype StrPackageOutput struct {\n\tName    string\n\tPath    string\n\tVersion string\n\tSize    string\n}\n```\n\n```go\ntype StrSizeDiff struct {\n\tName  string\n\tSize1 string\n\tSize2 string\n}\n```\n\n```go\ntype StrSizeEntry struct {\n\tName   string\n\tDigest string\n\tSize   string\n}\n```\n\n","path":"github.com/GoogleContainerTools/container-diff/util","name":"util","synopsis":"","isRedistributable":true}
