{"modulePath":"github.com/cssivision/container-diff","version":"v0.2.1-0.20170902190808-d6517898cb12","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Constants\n\n```go\nconst FSDiffOutput = `\n-----{{.DiffType}}-----\n\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`\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 HistoryDiffOutput = `\n-----{{.DiffType}}-----\n\nDocker history lines found only in {{.Image1}}:{{if not .Diff.Adds}} None{{else}}{{block \"list\" .Diff.Adds}}{{\"\\n\"}}{{range .}}{{print \"-\" .}}{{\"\\n\"}}{{end}}{{end}}{{end}}\n\nDocker history lines found only in {{.Image2}}:{{if not .Diff.Dels}} None{{else}}{{block \"list2\" .Diff.Dels}}{{\"\\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 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 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## 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 CheckImageID(image string) bool\n```\n\n```go\nfunc CheckImageURL(image string) bool\n```\n\n```go\nfunc CheckTar(image string) bool\n```\n\n```go\nfunc GetAddedEntries(d1, d2 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 Directory) []string\n```\n\n```go\nfunc GetDeletions(a, b []string) []string\n```\n\n```go\nfunc GetImageLayers(pathToImage string) []string\n```\n\n```go\nfunc GetMatches(a, b []string) []string\n```\n\n```go\nfunc GetModifiedEntries(d1, d2 Directory) []string\n```\nChecks for content differences between files of the same name from different directories\n\n```go\nfunc GetSize(path string) int64\n```\n\n```go\nfunc JSONify(diff interface{}) error\n```\n\n```go\nfunc TemplateOutput(diff interface{}, templateType string) error\n```\n\n```go\nfunc UnTar(filename string, target string) error\n```\nUnTar takes in a path to a tar file and writes the untarred version to the provided target. Only untars one level, does not untar nested tars.\n\n## Types\n\n```go\ntype AnalyzeResult struct {\n\tImage       string\n\tAnalyzeType string\n\tAnalysis    interface{}\n}\n```\n\n```go\ntype CloudPrepper struct {\n\tImagePrepper\n}\n```\nCloudPrepper prepares images sourced from a Cloud registry\n\n```go\ntype ConfigObject struct {\n\tEnv []string `json:\"Env\"`\n}\n```\n\n```go\ntype ConfigSchema struct {\n\tConfig  ConfigObject       `json:\"config\"`\n\tHistory []ImageHistoryItem `json:\"history\"`\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 []DirectoryEntry\n\tDels []DirectoryEntry\n\tMods []EntryDiff\n}\n```\n\n```go\nfunc DiffDirectory(d1, d2 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(diffType string) error\n```\n\n```go\ntype Directory struct {\n\tRoot    string\n\tContent []string\n}\n```\nDirectory stores a representaiton 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 GetDirectoryEntries(d Directory) []DirectoryEntry\n```\n\n```go\ntype EntryDiff struct {\n\tName  string\n\tSize1 int64\n\tSize2 int64\n}\n```\n\n```go\ntype Event struct {\n\tStatus         string `json:\"status\"`\n\tError          string `json:\"error\"`\n\tProgress       string `json:\"progress\"`\n\tProgressDetail struct {\n\t\tCurrent int `json:\"current\"`\n\t\tTotal   int `json:\"total\"`\n\t} `json:\"progressDetail\"`\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(analyzeType string) 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(diffType string) error\n```\n\n```go\ntype IDPrepper struct {\n\tImagePrepper\n}\n```\n\n```go\ntype Image struct {\n\tSource string\n\tFSPath string\n\tConfig ConfigSchema\n}\n```\n\n```go\ntype ImageHistoryItem struct {\n\tCreatedBy string `json:\"created_by\"`\n}\n```\n\n```go\ntype ImagePrepper struct {\n\tSource string\n\tClient *client.Client\n}\n```\n\n```go\nfunc (p ImagePrepper) GetImage() (Image, 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(resultType 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(resultType 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(diffType 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 PackageOutput struct {\n\tName    string\n\tPath    string `json:\",omitempty\"`\n\tVersion string\n\tSize    int64\n}\n```\n\n```go\ntype Prepper interface {\n\t// contains filtered or unexported methods\n}\n```\n\n```go\ntype Result interface {\n\tOutputStruct() interface{}\n\tOutputText(resultType 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(diffType 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(diffType 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 TarPrepper struct {\n\tImagePrepper\n}\n```\n\n","path":"github.com/cssivision/container-diff/utils","name":"utils","synopsis":"","isRedistributable":true}
