Documentation
¶
Overview ¶
Package fsview builds an in-memory merged view of an image's layered filesystem. Layers are overlaid in manifest order with whiteout and opaque-directory semantics, so the resulting tree describes the final rootfs without writing anything to disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanEntryName ¶
CleanEntryName turns a raw tar entry name into a clean slash-separated path relative to the tree root, rejecting names that escape the root.
func NormalizePath ¶
NormalizePath converts a user-provided in-image path into a clean relative path: "" denotes the tree root itself.
Types ¶
type Node ¶
type Node struct {
Name string // base name inside the tree
Path string // slash-separated path relative to the tree root; empty for the root itself
EntryName string // original entry name in the layer tar that defined this node
Kind Kind
Size int64
Mode int64 // raw tar mode, permission bits plus special bits
ModTime time.Time
UID int
GID int
Uname string
Gname string
Linkname string // symlink target, or hardlink source path inside the tree
Layer string // archive entry name of the layer that last defined this node
Children []*Node
}
Node is a single entry in the merged filesystem view of an image.
func Build ¶
Build merges every layer in order into a single in-memory tree, applying whiteout and opaque-directory semantics the same way on-disk extraction does.
func (*Node) Resolve ¶
Resolve walks the tree following the given clean relative path and returns the matching node, or nil when any component does not exist. An empty or root path returns the tree root itself.
func (*Node) SortedChildren ¶
SortedChildren returns the children in byte-wise name order, like ls.