Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/common
/ NewFileSecret
Function
NewFileSecret
config/http_config.go:801–803 ·
view source on GitHub ↗
(file string)
Source
from the content-addressed store, hash-verified
799
}
800
801
func
NewFileSecret(file string) *FileSecret {
802
return
&FileSecret{file: file}
803
}
804
805
func
(s *FileSecret) Fetch(context.Context) (string, error) {
806
fileBytes, err := os.ReadFile(s.file)
Callers
3
TestOAuth2WithFile
Function · 0.85
TestOAuth2WithJWTAuth
Function · 0.85
toSecret
Function · 0.85
Calls
no outgoing calls
Tested by
2
TestOAuth2WithFile
Function · 0.68
TestOAuth2WithJWTAuth
Function · 0.68