VictoriaMetrics/lib/promauth/util.go
Aliaksandr Valialkin d40441947a
app: allow specifying http and https urls in the following command-line flags
* -promscrape.config
* -relabelConfig
* -remoteWrite.relabelConfig
* -remoteWrite.urlRelabelConfig
2021-12-03 00:11:47 +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
}