utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const FSOutput = `` /* 462-byte string literal not displayed */
View Source
const HistoryOutput = `` /* 366-byte string literal not displayed */
View Source
const MultiVersionOutput = `` /* 592-byte string literal not displayed */
View Source
const SingleVersionOutput = `` /* 648-byte string literal not displayed */

Variables

This section is empty.

Functions

func BuildLayerTargets

func BuildLayerTargets(path, target string) ([]string, error)

BuildLayerTargets creates a string slice of the layers found at path with the target concatenated.

func CheckImageID

func CheckImageID(image string) bool

func CheckImageURL

func CheckImageURL(image string) bool

func CheckTar

func CheckTar(image string) bool

func DirToJSON

func DirToJSON(path string, target string, deep bool) error

DirToJSON records the directory structure starting at the provided path as in a json file.

func ExtractTar

func ExtractTar(path string) error

ExtractTar extracts the tar and any nested tar at the given path. After execution the original tar file is removed and the untarred version is in it place.

func GetAddedEntries

func GetAddedEntries(d1, d2 Directory) []string

func GetAdditions

func GetAdditions(a, b []string) []string

Modification of difflib's unified differ

func GetDeletedEntries

func GetDeletedEntries(d1, d2 Directory) []string

func GetDeletions

func GetDeletions(a, b []string) []string

func GetImageLayers

func GetImageLayers(pathToImage string) []string

func GetMatches

func GetMatches(a, b []string) []string

func GetModifiedEntries

func GetModifiedEntries(d1, d2 Directory) []string

Checks for content differences between files of the same name from different directories

func ImageToTar

func ImageToTar(cli client.APIClient, image, tarName string) (string, error)

ImageToTar writes an image to a .tar file

func JSONify

func JSONify(diff interface{}) error

func SetDockerEngine

func SetDockerEngine(useDocker bool)

func TarToDir

func TarToDir(tarPath string, deep bool) (string, string, error)

func TemplateOutput

func TemplateOutput(diff interface{}) error

func UnTar

func UnTar(filename string, path string) error

UnTar 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.

func ValidDockerVersion

func ValidDockerVersion() (bool, error)

ValidDockerVersion determines if there is a Docker client of the necessary version locally installed.

Types

type CloudPrepper

type CloudPrepper struct {
	ImagePrepper
}

CloudPrepper prepares images sourced from a Cloud registry

func (CloudPrepper) ImageToFS

func (p CloudPrepper) ImageToFS() (string, error)

type DiffResult

type DiffResult interface {
	GetStruct() DiffResult
	OutputText(diffType string) error
}

type DirDiff

type DirDiff struct {
	Image1 string
	Image2 string
	Adds   []string
	Dels   []string
	Mods   []string
}

func DiffDirectory

func DiffDirectory(d1, d2 Directory) DirDiff

type DirDiffResult

type DirDiffResult struct {
	DiffType string
	Diff     DirDiff
}

func (DirDiffResult) GetStruct

func (m DirDiffResult) GetStruct() DiffResult

func (DirDiffResult) OutputText

func (m DirDiffResult) OutputText(diffType string) error

type Directory

type Directory struct {
	Root    string
	Content []string
}

Directory stores a representaiton of a file directory.

func GetDirectory

func GetDirectory(dirpath string) (Directory, error)

type Event

type Event struct {
	Status         string `json:"status"`
	Error          string `json:"error"`
	Progress       string `json:"progress"`
	ProgressDetail struct {
		Current int `json:"current"`
		Total   int `json:"total"`
	} `json:"progressDetail"`
}

type HistDiff

type HistDiff struct {
	Image1 string
	Image2 string
	Adds   []string
	Dels   []string
}

type HistDiffResult

type HistDiffResult struct {
	DiffType string
	Diff     HistDiff
}

func (HistDiffResult) GetStruct

func (m HistDiffResult) GetStruct() DiffResult

func (HistDiffResult) OutputText

func (m HistDiffResult) OutputText(diffType string) error

type IDPrepper

type IDPrepper struct {
	ImagePrepper
}

func (IDPrepper) ImageToFS

func (p IDPrepper) ImageToFS() (string, error)

type Image

type Image struct {
	Source  string
	FSPath  string
	History []string
	Layers  []string
}

type ImagePrepper

type ImagePrepper struct {
	Source string
}

func (ImagePrepper) GetImage

func (p ImagePrepper) GetImage() (Image, error)

type Info

type Info struct {
	Package string
	Info1   PackageInfo
	Info2   PackageInfo
}

Info stores the information for one package in two different images.

type MultiVersionInfo

type MultiVersionInfo struct {
	Package string
	Info1   []PackageInfo
	Info2   []PackageInfo
}

MultiVersionInfo stores the information for one multi-version package in two different images.

type MultiVersionPackageDiff

type MultiVersionPackageDiff struct {
	Image1    string
	Packages1 map[string]map[string]PackageInfo
	Image2    string
	Packages2 map[string]map[string]PackageInfo
	InfoDiff  []MultiVersionInfo
}

MultiVersionPackageDiff stores the difference information between two images which could have multi-version packages.

type MultiVersionPackageDiffResult

type MultiVersionPackageDiffResult struct {
	DiffType string
	Diff     MultiVersionPackageDiff
}

func GetMultiVersionMapDiff

func GetMultiVersionMapDiff(map1, map2 map[string]map[string]PackageInfo, img1, img2 string) MultiVersionPackageDiffResult

GetMultiVersionMapDiff determines the differences between two image package maps with multi-version packages This getter supports multi version packages.

func (MultiVersionPackageDiffResult) GetStruct

func (MultiVersionPackageDiffResult) OutputText

func (m MultiVersionPackageDiffResult) OutputText(diffType string) error

type PackageDiff

type PackageDiff struct {
	Image1    string
	Packages1 map[string]PackageInfo
	Image2    string
	Packages2 map[string]PackageInfo
	InfoDiff  []Info
}

PackageDiff stores the difference information between two images.

type PackageDiffResult

type PackageDiffResult struct {
	DiffType string
	Diff     PackageDiff
}

func GetMapDiff

func GetMapDiff(map1, map2 map[string]PackageInfo, img1, img2 string) PackageDiffResult

GetMapDiff determines the differences between maps of package names to PackageInfo structs This getter supports only single version packages.

func (PackageDiffResult) GetStruct

func (m PackageDiffResult) GetStruct() DiffResult

func (PackageDiffResult) OutputText

func (m PackageDiffResult) OutputText(diffType string) error

type PackageInfo

type PackageInfo struct {
	Version string
	Size    string
}

PackageInfo stores the specific metadata about a package.

type Prepper

type Prepper interface {
	ImageToFS() (string, error)
}

type TarPrepper

type TarPrepper struct {
	ImagePrepper
}

func (TarPrepper) ImageToFS

func (p TarPrepper) ImageToFS() (string, error)

Jump to

Keyboard shortcuts

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