code: func New(nodes []string, scheme, cert, key, caCert string, basicAuth bool, username string, password string) (*ConsulClient, error) {
  	conf := api.DefaultConfig()
  
  	conf.Scheme = scheme
  
  	if len(nodes) > 0 {
  		conf.Address = nodes[0]
  	}
  
  	if basicAuth {
  		conf.HttpAuth = &api.HttpBasicAuth{
  			Username: username,
  			Password: password,
  		}
  	}
  
  	if cert != "" && key != "" {
  		conf.TLSConfig.CertFile = cert
  		conf.TLSConfig.KeyFile = key
  	}
  	if caCert != "" {
  		conf.TLSConfig.CAFile = caCert
  	}
  
  	client, err := api.NewClient(conf)
  	if err != nil {
  		return nil, err
  	}
  	return &ConsulClient{client.KV()}, nil
  }
docs: // NewConsulClient returns a new client to Consul for the given address