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