go-api-pkg/fluentd/config.go

18 lines
251 B
Go
Raw Permalink Normal View History

2022-12-01 17:56:11 +01:00
package fluentd
import (
"strconv"
"strings"
)
func ParseAddr(addr string) (string, int, error) {
2022-12-01 17:56:11 +01:00
p := strings.Split(addr, ":")
fHost := p[0]
fPort, err := strconv.Atoi(p[1])
if err != nil {
return "", 0, err
}
2022-12-01 17:56:11 +01:00
return fHost, fPort, nil
2022-12-01 17:56:11 +01:00
}