package console import ( "github.com/carlosframework/platform/internal/boxchoice" ) // The box eligibility predicate and the choice live in internal/boxchoice, // the contract console and moves share. These names keep console's own // vocabulary. type ( boxCandidate = boxchoice.Candidate rosterBox = boxchoice.RosterBox boxLoad = boxchoice.Load ) // eligibleBoxes is boxchoice.Eligible on console's edges snapshot. The // snapshot is complete only when both its files and its liveness are // (edgesfile.Snapshot.EvidenceComplete). func eligibleBoxes(snap edgesSnapshot, roster map[string]rosterBox, placement, awsRegion, homeName, expectedFP string, lost map[string]bool) []boxCandidate { return boxchoice.Eligible(boxSnapshot(snap), roster, placement, awsRegion, homeName, expectedFP, lost) } // boxSnapshot is edgesfile.Snapshot.BoxChoice. func boxSnapshot(snap edgesSnapshot) boxchoice.Snapshot { return snap.BoxChoice() } // chooseBox is boxchoice.Choose. func chooseBox(host string, cands []boxCandidate, running map[string]boxLoad, app string) (boxCandidate, bool) { return boxchoice.Choose(host, cands, running, app) }