Documentation
¶
Overview ¶
Package inventory walks regular source files within a hard root boundary and records reported skips. Fixed cache and dependency directories, unreadable directories, non-regular files, refused symlinks, source classification, and resource limits may omit files. Generated-file claims in names or contents and arbitrary dot paths do not.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// Path is relative to the scan root, using forward slashes, so results
// are stable across platforms
Path string
Abs string
Size int64
Lang language.ID
// MaxBytes truncates an oversized file instead of dropping it. The limit
// still downgrades coverage.
MaxBytes int64
}
Entry is one file worth parsing
type Limits ¶
type Limits struct {
MaxFileSize int64 // truncate a single file larger than this
MaxTotalSize int64 // stop once the sum of included file sizes reaches this
MaxFiles int // stop once this many files have been included
MaxSymlinkDepth int // longest chain of directory symlinks followed
MaxDirDepth int // longest chain of plain (non-symlink) directories descended
}
Limits bound how much of a hostile tree the walk will look at
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits are generous enough for a real repository and small enough that a crafted tree (a symlink loop, a directory of many huge files) cannot turn a scan into a memory exhaustion attack
type Result ¶
Result is what one walk found