MCPcopy Create free account
hub / github.com/cortexproject/cortex / RegisterFlagsWithPrefix

Method RegisterFlagsWithPrefix

pkg/api/api.go:104–108  ·  view source on GitHub ↗

RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix.

(prefix string, f *flag.FlagSet)

Source from the content-addressed store, hash-verified

102
103// RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with the set prefix.
104func (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
111func (cfg *Config) Validate() error {

Callers 7

RegisterFlagsMethod · 0.95
RegisterFlagsMethod · 0.95
RegisterFlagsMethod · 0.45
RegisterFlagsMethod · 0.45
RegisterFlagsMethod · 0.45
RegisterFlagsMethod · 0.45
RegisterFlagsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected