Documentation ¶
Overview ¶
Package pathset contains the various path-sets for the director. These spill into a separate package on the basis of there being so many of them.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct { // SavedPaths contains the save pathset for this machine. Saved saver.Pathset // ScratchPaths contains the scratch pathset for this machine. Scratch Scratch }
Instance is an instance-specific pathset.
type Pathset ¶
type Pathset struct { // DirSaved is the directory into which saved runs get copied. DirSaved string // DirScratch is the directory that the director uses for ephemeral run data. DirScratch string }
Pathset contains the pre-computed paths used by the director.
func New ¶
New constructs a new pathset from the directory root.
Example ¶
ExampleNew is a runnable example for New.
package main import ( "fmt" "path/filepath" "github.com/c4-project/c4t/internal/director/pathset" ) func main() { p := pathset.New(filepath.FromSlash("tests")) fmt.Println(filepath.ToSlash(p.DirScratch)) fmt.Println(filepath.ToSlash(p.DirSaved)) }
Output: tests/scratch tests/saved
func (Pathset) Instance ¶
Instance gets the instance pathset for a machine with ID mid.
Example ¶
ExamplePathset_Instance is a runnable example for Pathset.Instance.
package main import ( "fmt" "path/filepath" "github.com/c4-project/c4t/internal/director/pathset" "github.com/c4-project/c4t/internal/id" ) func main() { p := pathset.Pathset{DirSaved: "saved", DirScratch: "scratch"} mid := id.FromString("foo.bar.baz") mi := p.Instance(mid) for _, path := range mi.Scratch.Dirs() { fmt.Println(filepath.ToSlash(path)) } for _, path := range mi.Saved.DirList() { fmt.Println(filepath.ToSlash(path)) } }
Output: scratch/foo/bar/baz/fuzz scratch/foo/bar/baz/lift scratch/foo/bar/baz/run saved/foo/bar/baz/flagged saved/foo/bar/baz/compile_fail saved/foo/bar/baz/compile_timeout saved/foo/bar/baz/run_fail saved/foo/bar/baz/run_timeout
type Scratch ¶
type Scratch struct { // DirFuzz is the directory to which fuzzed subjects will be output. DirFuzz string // DirLift is the directory to which lifter outputs will be written. DirLift string // DirRun is the directory into which c4t-mach output will go. DirRun string }
Scratch contains the pre-computed paths for a machine run.
func NewScratch ¶
NewScratch creates a machine pathset rooted at root.
Example ¶
ExampleNewScratch is a runnable example for NewScratch.
package main import ( "fmt" "path/filepath" "github.com/c4-project/c4t/internal/director/pathset" ) func main() { p := pathset.NewScratch("scratch") fmt.Println("run: ", filepath.ToSlash(p.DirRun)) fmt.Println("lift:", filepath.ToSlash(p.DirLift)) fmt.Println("fuzz:", filepath.ToSlash(p.DirFuzz)) }
Output: run: scratch/run lift: scratch/lift fuzz: scratch/fuzz