Files
nextcloud-ng_backup/lib/Repository/IIndexCache.php
T
dillard 05e2c9fe45 M2: local cache of pack indexes (ngb_index)
Opening a repository lists index/ once and downloads only index files
that are not cached; packs written by this server are cached on write,
stale cache rows are dropped. Each resumable step therefore no longer
downloads every index file from the location.
2026-10-02 00:55:46 +02:00

21 lines
737 B
PHP

<?php
declare(strict_types=1);
// SPDX-FileCopyrightText: 2026 Dillard Blom
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace OCA\NgBackup\Repository;
/** Optional local cache of pack index entries (the repository's index/ files stay authoritative). */
interface IIndexCache {
/** @return array<string, list<array{id:string, offset:int, length:int, raw:int, flags:int}>> packId => entries */
public function all(string $repositoryId): array;
/** @param list<array{id:string, offset:int, length:int, raw:int, flags:int}> $entries */
public function put(string $repositoryId, string $packId, array $entries): void;
/** @param list<string> $packIds */
public function remove(string $repositoryId, array $packIds): void;
}