Documentation
¶
Overview ¶
Package binding reads a repo's harness binding, the file .physa/harness.toml that binds Physa's harness contract to the team's own commands, and says which level of the contract the repo meets: 0 with no binding, 1 with start and result, 2 with asks as well. It keeps every command exactly as written and never runs, parses or expands one. A binding that is not valid comes back as an Error naming every missing, unknown or wrongly typed key, with its line where the file has one.
Index ¶
Constants ¶
const Path = ".physa/harness.toml"
Path is where a repo keeps its harness binding, relative to the repo's root.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
Binding is a harness binding: the team's command line for each verb of the harness contract, each exactly as written, or empty where none is bound.
type Error ¶
type Error struct {
Problems []Problem
}
Error is a binding that was read but is not valid. Problems are in file order, with missing keys last.
type Kind ¶
type Kind int
Kind is what is wrong with a binding.
const ( // NotTOML is a file that is not TOML. NotTOML Kind = iota + 1 // WrongType is a key whose value is not what the binding needs there: a // table for run and report, a string for a command. WrongType // Unknown is a key the binding does not have. Unknown // Missing is a required command that is absent, empty or blank. Missing )
The kinds of Problem.
type Problem ¶
type Problem struct {
// Kind is what is wrong.
Kind Kind
// Key is the key, dotted and spelled as written: "run.result", "reprt",
// "run.Start". A part TOML would
// quote is quoted. It is empty for a file that is not TOML.
Key string
// Line is the key's line in the file, from 1, or 0 where there is none,
// as for a missing key.
Line int
// Detail is, for a file that is not TOML, the TOML library's message; for
// a wrong type, what the key must be ("a string" or "a table").
Detail string
// contains filtered or unexported fields
}
Problem is one thing wrong with a binding.