code: func newClient(scope string, kv string, addr string, config *store.Config, cached bool) (DataStore, error) {
  
  	if cached && scope != LocalScope {
  		return nil, fmt.Errorf("caching supported only for scope %s", LocalScope)
  	}
  	sequential := false
  	if scope == LocalScope {
  		sequential = true
  	}
  
  	if config == nil {
  		config = &store.Config{}
  	}
  
  	var addrs []string
  
  	if kv == string(store.BOLTDB) {
  		// Parse file path
  		addrs = strings.Split(addr, ",")
  	} else {
  		// Parse URI
  		parts := strings.SplitN(addr, "/", 2)
  		addrs = strings.Split(parts[0], ",")
  
  		// Add the custom prefix to the root chain
  		if len(parts) == 2 {
  			rootChain = append([]string{parts[1]}, defaultRootChain...)
  		}
  	}
  
  	store, err := libkv.NewStore(store.Backend(kv), addrs, config)
  	if err != nil {
  		return nil, err
  	}
  
  	ds := &datastore{scope: scope, store: store, active: true, watchCh: make(chan struct{}), sequential: sequential}
  	if cached {
  		ds.cache = newCache(ds)
  	}
  
  	return ds, nil
  }
docs: // newClient used to connect to KV Store