func (cfg *ConnConfig) auth() string {
	if cfg.User != "" || cfg.Pwd != "" {
		return fmt.Sprintf("%s:%s", cfg.User, cfg.Pwd)
	}
	return ""
}
auth returns a string of "User:Pwd".
package zk
import (
	"bytes"
	"errors"
	"fmt"
	"math/rand"
	"net"
	"path"
	"time"
	"github.com/mesosphere/go-zookeeper/zk"
	"go.uber.org/atomic"
	"github.com/samaritan-proxy/sash/logger"
)
var (
	errConnectTimeout = errors.New("zk connect timeout")
)
func init() {
	rand.Seed(time.Now().UnixNano())
}
type ConnConfig struct {
	Hosts          []string      `yaml:"hosts"`
	User           string        `yaml:"user"`
	Pwd            string        `yaml:"pwd"`
	ConnectTimeout time.Duration `yaml:"connect_timeout"`
	SessionTimeout time.Duration `yaml:"session_timeout"`
	BasePath       string        `yaml:"base_path"`
}