func ValidateHost(val string) (string, error) { host, err := parsers.ParseHost(DefaultHTTPHost, DefaultUnixSocket, val) if err != nil { return val, err } return host, nil }
func ValidateHost(val string) (string, error) { host, err := parsers.ParseHost(DEFAULTHTTPHOST, DEFAULTUNIXSOCKET, val) if err != nil { return val, err } return host, nil }
func newDnetConnection(val string) (*dnetConnection, error) { url, err := parsers.ParseHost(DefaultHTTPHost, DefaultUnixSocket, val) if err != nil { return nil, err } protoAddrParts := strings.SplitN(url, "://", 2) if len(protoAddrParts) != 2 { return nil, fmt.Errorf("bad format, expected tcp://ADDR") } if strings.ToLower(protoAddrParts[0]) != "tcp" { return nil, fmt.Errorf("dnet currently only supports tcp transport") } return &dnetConnection{protoAddrParts[0], protoAddrParts[1]}, nil }