carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package moves
2
3// SwitchEnv is the operator-off switch of Phase 1 (index D13): every move
4// entry point is behind it, and its default is off until the copy record
5// is approved.
6const SwitchEnv = "CARLOS_MOVES_PHASE1"
7
8// DefaultEnabled is the compiled default. The copy gate
9// (approved_copy_test.go) requires it false while any copy row is pending.
10const DefaultEnabled = false
11
12// Enabled reads the switch. Unset means the default; "on", "1" and "true"
13// enable; anything else is off.
14func Enabled(getenv func(string) string) bool {
15 switch getenv(SwitchEnv) {
16 case "":
17 return DefaultEnabled
18 case "on", "1", "true":
19 return true
20 }
21 return false
22}
23