NoAPIFor found the protocols the provider speaks for every model it
was asked about, and APIs did again through ModelAPI, so a list of N
models built 2N Speaks slices. The providers' page, ExposedOf and
servable ask it for each model of each provider: 16 MB of what twenty
window polls allocated with real accounts (m2463 profile).
NoAPI() finds the protocols once and gives a func for each model;
APIs and ModelAPI take them through apisAmong and modelAPIAmong.
NoAPIFor, APIs and ModelAPI answer as before.
Test: TestNoAPIFindsTheProvidersAPIsOnce. 100 models of a relay,
half listed on chat: Speaks looked up once (5 at most, for another
test's look), the chat half kept, NoAPIFor the same for each.
Run on mote, at this tree:
- gofmt, go vet (darwin, windows, linux): ok
- the new test with TestExposedOnlyOnTheAPIsTheProviderHas and
TestListedAPIsCost, 3 times: ok
- broken by hand (NoAPI back to a per-model NoAPIFor): red, "100
models looked up the provider's APIs 200 times"
- go test ./internal/provider: ok
- go test ./internal/gui (before the apisAmong step, which touches
internal/provider only): every test ok except the known
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510)
Not run: an A/B with the real-account sandbox for this change alone.