MCPcopy Create free account
hub / github.com/prometheus/common / SetDirectory

Method SetDirectory

config/http_config.go:317–326  ·  view source on GitHub ↗

SetDirectory joins any relative file paths with dir.

(dir string)

Source from the content-addressed store, hash-verified

315
316// SetDirectory joins any relative file paths with dir.
317func (c *HTTPClientConfig) SetDirectory(dir string) {
318 if c == nil {
319 return
320 }
321 c.TLSConfig.SetDirectory(dir)
322 c.BasicAuth.SetDirectory(dir)
323 c.Authorization.SetDirectory(dir)
324 c.OAuth2.SetDirectory(dir)
325 c.BearerTokenFile = JoinDir(dir, c.BearerTokenFile)
326}
327
328// Validate validates the HTTPClientConfig to check only one of BearerToken,
329// BasicAuth and BearerTokenFile is configured. It also validates that ProxyURL

Callers

nothing calls this directly

Calls 2

JoinDirFunction · 0.85
SetDirectoryMethod · 0.65

Tested by

no test coverage detected