Documentation ¶
Index ¶
- Constants
- type Path
- func (p Path) AllPaths() []Path
- func (p Path) Basename() string
- func (p Path) ConstituentPaths() []Path
- func (p Path) IsAbsolutePath() bool
- func (p Path) IsDirWhiteout() bool
- func (p Path) IsFileWhiteout() bool
- func (p Path) IsWhiteout() bool
- func (p Path) Normalize() Path
- func (p Path) ParentPath() (Path, error)
- func (p Path) UnWhiteoutPath() (Path, error)
- type PathSet
- type PathStack
- type Paths
Constants ¶
const ( // WhiteoutPrefix is the prefix for whiteout file. // See https://github.com/opencontainers/image-spec/blob/main/layer.md#whiteouts WhiteoutPrefix = ".wh." // OpaqueWhiteout is the opaque whiteout file. // See https://github.com/opencontainers/image-spec/blob/main/layer.md#opaque-whiteout OpaqueWhiteout = WhiteoutPrefix + WhiteoutPrefix + ".opq" // PathSeparator is the string alias of os.PathSeparator PathSeparator = string(os.PathSeparator) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path string
Path represents a file path
func (Path) AllPaths ¶
AllPaths returns all constituent paths of the current path + the current path itself (e.g. /home/wagoodman/file.txt -> /, /home, /home/wagoodman, /home/wagoodman/file.txt )
func (Path) ConstituentPaths ¶
ConstituentPaths returns all constituent paths for the current path (not including the current path itself) (e.g. /home/wagoodman/file.txt -> /, /home, /home/wagoodman )
func (Path) IsAbsolutePath ¶
IsAbsolutePath returns true if the path is an absolute path.
func (Path) IsDirWhiteout ¶
IsDirWhiteout indicates if the path has a basename is a opaque whiteout (which means all parent directory contents should be ignored during squashing)
func (Path) IsFileWhiteout ¶
IsFileWhiteout indicates if the file basename has a whiteout prefix, except a directory (which means that the file should be removed during squashing)
func (Path) IsWhiteout ¶
IsWhiteout indicates if the file basename has a whiteout prefix (which means that the file should be removed during squashing)
func (Path) Normalize ¶
Normalize returns the cleaned file path representation (trimmed of spaces and resolve relative notations)
func (Path) ParentPath ¶
ParentPath returns a path object to the current files parent directory (or errors out if there is no parent)
func (Path) UnWhiteoutPath ¶
UnWhiteoutPath is a representation of the current path with no whiteout prefixes
type PathSet ¶
type PathSet map[Path]struct{}
PathSet is a set of paths.