| 179 | } |
| 180 | |
| 181 | Result<BytesView> KeyValueStore::serialize() { |
| 182 | ValdiArchiveBuilder builder; |
| 183 | |
| 184 | auto entries = collectEntries(); |
| 185 | ByteBuffer manifest; |
| 186 | buildManifest(entries, manifest); |
| 187 | builder.addEntry(ValdiArchiveEntry(manifestEntryName(), manifest.data(), manifest.size())); |
| 188 | |
| 189 | for (const auto& it : entries) { |
| 190 | builder.addEntry(ValdiArchiveEntry(it.first, it.second.data.data(), it.second.data.size())); |
| 191 | } |
| 192 | |
| 193 | return builder.build()->toBytesView(); |
| 194 | } |
| 195 | |
| 196 | bool KeyValueStore::isEntryExpired(const KeyValueStoreEntry& entry) const { |
| 197 | if (entry.expirationDate == 0) { |