Documentation
¶
Overview ¶
Package tools builds the Diagnostics tab's tools view: the Go programs installed in a bin directory, judged by go-fleettools/staletools used as a library (never as a program): staleness for the toolchain and the release each was built from, sumverify for whether sum.golang.org confirms the module it was built from.
Both reach the network (the module proxy, the checksum database), so a Runner does the work on its own goroutine, far apart, and the snapshots only read its last answer. A tool whose file did not change since a pass that gave it a final verdict is not hashed again.
Index ¶
Constants ¶
const RefreshEvery = 5 * time.Minute
RefreshEvery is how often Run measures again: the proxy answers are cached for six hours by staletools, and only a changed file is hashed again.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
Dir string // the directory scanned
Display string // how the user writes it (~/.local/bin)
Want string // the toolchain the others are compared with
Scan func(dirs []string) ([]staleness.Binary, error)
Releases func(ctx context.Context, modules []string) map[string]staleness.Release
Verify func(path string) (sumverify.Result, error)
Now func() time.Time
// contains filtered or unexported fields
}
Engine measures the installed tools. The func fields are the seams a test replaces; Config fills them with staletools.
type Runner ¶
type Runner struct {
Eng *Engine
// Every is the time between two passes; 0 means RefreshEvery.
Every time.Duration
// contains filtered or unexported fields
}
Runner keeps the latest view of an Engine.