RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix.
(prefix string, f *flag.FlagSet)
| 102 | |
| 103 | // RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix. |
| 104 | func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { |
| 105 | f.StringVar(&cfg.AlertmanagerHTTPPrefix, prefix+"http.alertmanager-http-prefix", "/alertmanager", "HTTP URL path under which the Alertmanager ui and api will be served.") |
| 106 | f.StringVar(&cfg.PrometheusHTTPPrefix, prefix+"http.prometheus-http-prefix", "/prometheus", "HTTP URL path under which the Prometheus api will be served.") |
| 107 | f.StringVar(&cfg.corsRegexString, prefix+"server.cors-origin", ".*", `Regex for CORS origin. It is fully anchored. Example: 'https?://(domain1|domain2)\.com'`) |
| 108 | } |
| 109 | |
| 110 | // validate config |
| 111 | func (cfg *Config) Validate() error { |
no outgoing calls
no test coverage detected