go-api-pkg/fluentd/config.go

18 lines
251 B
Go

package fluentd
import (
"strconv"
"strings"
)
func ParseAddr(addr string) (string, int, error) {
p := strings.Split(addr, ":")
fHost := p[0]
fPort, err := strconv.Atoi(p[1])
if err != nil {
return "", 0, err
}
return fHost, fPort, nil
}