pathutils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const CacheKeyValueFileName = "cache_key_value.json"

CacheKeyValueFileName is the name of local cache key value file.

View Source
const DefaultBinaryPath = "/makisu-internal/makisu"

DefaultBinaryPath is Makisu binary path. It should be excluded from all file operations.

View Source
const DefaultCACertsPath = "/makisu-internal/certs/cacerts.pem"

DefaultCACertsPath containsa list of common CA certs. These certs are generated by ca-certficates debian package and appended to system certs.

View Source
const DefaultInternalDir = "/makisu-internal"

DefaultInternalDir is used for Makisu binary and certs.

View Source
const DefaultStorageDir = "/makisu-storage"

DefaultStorageDir is the default directory makisu uses for persisted data like cached image layers. This directory should be mounted for better performance, if makisu runs in a container.

Variables

View Source
var (
	// DefaultBlacklist is the list of all paths that should be ignored when
	// copying directories around and computing filesystem diffs.
	DefaultBlacklist = append([]string{
		DefaultInternalDir,

		"/dev",
		"/.dockerinit",
		"/srv",
		"/mnt",
	}, dockerBlacklist...)
)

Functions

func AbsPath

func AbsPath(p string) string

AbsPath fixes leading and trailing slashes of paths for all cases: - Layers generated by docker doesn't have leading slashes. - Internally generated paths might have leading slashes. - Directories have trailing slashes. - Files don't have trailing slashes.

func IsDescendantOfAny

func IsDescendantOfAny(p string, ancestors []string) bool

IsDescendantOfAny returns true if filename is in any ancestor's subtree.

func RelPath

func RelPath(p string) string

RelPath removes leading "/". Tar headers produced by docker doesn't have leading slashes.

func SplitPath

func SplitPath(p string) []string

SplitPath trims and splits a path on "/". If the path is "/", returns a nil slice.

func TrimRoot

func TrimRoot(p, root string) (string, error)

TrimRoot removes the 'root' path prefix from a path. If the prefix is not present, returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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