Documentation ¶
Overview ¶
Package planner contains the logic for the test planner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrBProbeNil = errors.New("backend finder nil") ErrSProbeNil = errors.New("subject prober nil") )
Functions ¶
func ExpandLitmusInputs ¶
ExpandLitmusInputs expands a list of possible Litmus files or containing directories into a flat file list.
Types ¶
type CompilerLister ¶
type CompilerLister interface { // Compilers asks the compiler inspector to list all available compilers. Compilers() (map[id.ID]compiler.Compiler, error) }
CompilerLister is the interface of things that can query compiler information for a particular machine.
type CompilerPlanner ¶
type CompilerPlanner struct { // Lister lists the available compilers. Lister CompilerLister // Filter is the filtering glob to use on compiler names. Filter id.ID // Observers contains observers for the CompilerPlanner. Observers []compiler.Observer }
CompilerPlanner contains the state necessary to make up the compiler part of a test plan.
func (*CompilerPlanner) Plan ¶
func (c *CompilerPlanner) Plan() (compiler.InstanceMap, error)
Plan constructs the compiler set for a plan.
type CorpusPlanner ¶
type CorpusPlanner struct { // Files contains the files that are to be included in the plan. Files []string // Observers observe the process of building the corpus. Observers []builder.Observer // Prober tells the planner how to probe corpus files for specific information. Prober SubjectProber // Quantities contains the target size and worker count of the corpus. Quantities quantity.PlanSet }
CorpusPlanner contains the state required to plan the corpus part of an initial plan file.
type Kind ¶
type Kind uint8
Kind is the enumeration of kinds of planner message.
const ( // KindStart means that the planner is starting. // Quantities points to the planner's quantity set. KindStart Kind = iota // KindPlanningBackend means that the planner is now getting information about the backend to use. KindPlanningBackend // KindPlanningCorpus means that the planner is now getting information about the corpus. // The corpus will be announced as a series of OnBuild messages. KindPlanningCorpus // KindPlanningCompilers means that the planner is now getting information about the compilers for a given machine. // MachineID points to the name of the machine. // The selected compilers will be announced as a series of OnCompilerConfig messages. KindPlanningCompilers )
type Message ¶
type Message struct { // Kind is the kind of message being sent. Kind Kind // Quantities points to the quantity set on start messages. Quantities *quantity.PlanSet // MachineID contains the machine identifier in certain messages. MachineID id.ID }
Message is the type of messages sent through OnPlan.
type Observer ¶
type Observer interface { compiler.Observer builder.Observer // OnPlan is sent when the planner is doing something new. OnPlan(m Message) }
Observer is the type of observers for the planner.
type Option ¶
Option is the type of options to the Planner constructor.
func FilterCompilers ¶
FilterCompilers sets the glob used for filtering compilers.
func ObserveWith ¶
ObserveWith adds each observer in obs to the observer pool.
func OverrideQuantities ¶
OverrideQuantities overrides this planner's quantities with qs.
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
Planner holds all configuration for the test planner.
type Source ¶
type Source struct { // BProbe is the backend finder. BProbe backend2.Finder // SProbe is the subject prober. SProbe SubjectProber }
Source contains all of the various sources for a Planner's information.
type SubjectProber ¶
type SubjectProber interface { // ProbeSubject probes the Litmus test at filepath litmus, producing a named subject record. ProbeSubject(ctx context.Context, litmus string) (*subject.Named, error) }
SubjectProber is the interface of types that allow filling in of subject information.