code: func NewEtcdServiceDiscovery(
  	config *config.Config,
  	server *Server,
  	appDieChan chan bool,
  	cli ...*clientv3.Client,
  ) (ServiceDiscovery, error) {
  	var client *clientv3.Client
  	if len(cli) > 0 {
  		client = cli[0]
  	}
  	sd := &etcdServiceDiscovery{
  		config:          config,
  		running:         false,
  		server:          server,
  		serverMapByType: make(map[string]map[string]*Server),
  		listeners:       make([]SDListener, 0),
  		stopChan:        make(chan bool),
  		stopLeaseChan:   make(chan bool),
  		appDieChan:      appDieChan,
  		cli:             client,
  	}
  
  	sd.configure()
  
  	return sd, nil
  }
docs: // NewEtcdServiceDiscovery ctor