code: func (s *Store) KVSSetCAS(idx uint64, entry *structs.DirEntry) (bool, error) {
  	tx := s.db.Txn(true)
  	defer tx.Abort()
  
  	set, err := s.kvsSetCASTxn(tx, idx, entry)
  	if !set || err != nil {
  		return false, err
  	}
  
  	tx.Commit()
  	return true, nil
  }
docs: // KVSSetCAS is used to do a check-and-set operation on a KV entry. The
  // ModifyIndex in the provided entry is used to determine if we should
  // write the entry to the state store or bail. Returns a bool indicating
  // if a write happened and any error.