VictoriaMetrics/lib/promauth/util.go
Aliaksandr Valialkin 06642d97f5
app: allow specifying http and https urls in the following command-line flags
* -promscrape.config
* -relabelConfig
* -remoteWrite.relabelConfig
* -remoteWrite.urlRelabelConfig
2021-12-03 00:10:02 +02:00

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
}