mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
06642d97f5
* -promscrape.config * -relabelConfig * -remoteWrite.relabelConfig * -remoteWrite.urlRelabelConfig
18 lines
320 B
Go
18 lines
320 B
Go
package promauth
|
|
|
|
import (
|
|
"strings"
|
|
"unicode"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fs"
|
|
)
|
|
|
|
func readPasswordFromFile(path string) (string, error) {
|
|
data, err := fs.ReadFileOrHTTP(path)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
pass := strings.TrimRightFunc(string(data), unicode.IsSpace)
|
|
return pass, nil
|
|
}
|