Documentation
¶
Overview ¶
Package mapper builds a model-free map of a target: its languages, frameworks, entry points, trust boundaries, and how to build and test it. The planner and investigators start from this map instead of rediscovering the layout on every run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boundary ¶
type Boundary struct {
Kind string `json:"kind"` // http-input|env|process|database|outbound-http|filesystem|deserialization
File string `json:"file"`
Line int `json:"line"`
}
Boundary is a line where data crosses a trust boundary.
type EntryPoint ¶
type EntryPoint struct {
Kind string `json:"kind"` // http-route|main|cli|handler
File string `json:"file"`
Line int `json:"line"`
Detail string `json:"detail"`
}
EntryPoint is a place where execution or outside input enters the program.
type Harness ¶
type Harness struct {
Language string `json:"language,omitempty"` // primary language: go|python|javascript|typescript
TestCommand string `json:"test_command,omitempty"`
BuildCommand string `json:"build_command,omitempty"`
HasTests bool `json:"has_tests"`
}
Harness says how the target is built and tested, as far as can be told without running anything.
type Map ¶
type Map struct {
Commit string `json:"commit,omitempty"`
FileCount int `json:"file_count"`
Languages []LangCount `json:"languages"`
Frameworks []string `json:"frameworks,omitempty"`
Entry []EntryPoint `json:"entry_points,omitempty"`
Boundaries []Boundary `json:"trust_boundaries,omitempty"`
InfraFiles []string `json:"infra_files,omitempty"`
Tests Harness `json:"tests"`
Skipped []walk.Skip `json:"skipped,omitempty"`
// Files is the listing the map was built from. It is not cached: it
// holds absolute paths, which belong to one machine.
Files []walk.File `json:"-"`
}
Map describes a target on disk.
func (Map) LanguageNames ¶
LanguageNames returns the language names, most files first.
type Options ¶
type Options struct {
// CacheDir, when set, enables the commit-keyed cache.
CacheDir string
// Walk holds the configured path exclusions and inclusions. The cache
// is not used when any are set, because it is keyed by commit alone.
Walk walk.Options
// Texts, when set, receives the text of every file the mapper reads,
// so the seeders that run next do not read those files again.
Texts *walk.Texts
// Changed, when set, lists the files (relative to root, with forward
// slashes) that differ from HEAD: the uncommitted work of a --changed
// scan. With a cached map of HEAD, only those files are read again and
// the rest of the map is taken from the cache. Without it, a tree with
// local changes is mapped in full.
Changed map[string]bool
}
Options control mapping.