Validate rejects unknown values up front so callers don't have to wait for the deep bootstrap planning path to surface them. It runs on every request method regardless of whether the value will end up being consulted, since silently accepting a typo on a non-bootstrap path is worse than failing fast
()
| 65 | // up being consulted, since silently accepting a typo on a |
| 66 | // non-bootstrap path is worse than failing fast. |
| 67 | func (o AdvancedOptions) Validate() error { |
| 68 | switch o.BootstrapStrategy { |
| 69 | case "", BootstrapStrategyFirstParent, BootstrapStrategyTopo: |
| 70 | return nil |
| 71 | default: |
| 72 | return fmt.Errorf("unsupported bootstrap strategy %q (want %q or %q)", |
| 73 | o.BootstrapStrategy, BootstrapStrategyFirstParent, BootstrapStrategyTopo) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | type ProbeRequest struct { |
| 78 | Source gitsync.Endpoint |
no outgoing calls