#include "cyborgdb_core/client.hpp"
#include "cyborgdb_core/encrypted_index.hpp"
#include <array>
#include <random>
// Using `memory` storage for this example
cyborg::DBConfig index_location(cyborg::Location::kMemory);
cyborg::DBConfig config_location(cyborg::Location::kMemory);
// Get your API key
std::string api_key = "your_api_key_here"; // Replace with your actual API key
// Create a client
cyborg::Client client(api_key, index_location, config_location);
// Generate a 32-byte random encryption key
std::array<uint8_t, 32> index_key;
std::random_device rd;
std::generate(index_key.begin(), index_key.end(), [&]() { return rd() % 256; });
// Set max cache size at 1MB
std::size_t max_cache_size = 1000000;
// Create an encrypted index
auto index = client.LoadIndex("my_index", index_key, max_cache_size);