feat: add IPartialMountProvider to support authoritative mounts
IMountProviders implementing this interface will be able to take advantage of authoritative mounts. The function `getMountsFromMountPoints` will receive the path that the provider is asked to set-up and an array of IMountProviderArgs providing information regarding the stored mount points and the file cache data for the related root. The mount provider should verify the validity of the mounts and return IMountPoints related to them. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>pull/55072/head
parent
9b519b4679
commit
fcdb28e4a3
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Files\Config;
|
||||
|
||||
use OCP\Files\Cache\ICacheEntry;
|
||||
|
||||
/**
|
||||
* Data-class containing information related to a mount and its root.
|
||||
*
|
||||
* @since 33.0.0
|
||||
*/
|
||||
class IMountProviderArgs {
|
||||
public function __construct(
|
||||
public ICachedMountInfo $mountInfo,
|
||||
public ICacheEntry $cacheEntry,
|
||||
) {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Files\Config;
|
||||
|
||||
use OCP\Files\Mount\IMountPoint;
|
||||
use OCP\Files\Storage\IStorageFactory;
|
||||
|
||||
/**
|
||||
* This interface marks mount providers that can provide IMountPoints related to
|
||||
* a path based on the provided mount and root metadata.
|
||||
*
|
||||
* @since 33.0.0
|
||||
*/
|
||||
interface IPartialMountProvider extends IMountProvider {
|
||||
|
||||
/**
|
||||
* Called during the Filesystem setup of a specific path.
|
||||
*
|
||||
* The provided arguments give information about the path being set up,
|
||||
* as well as information about mount points known to be provided by the
|
||||
* mount provider and contained in the path or in its sub-paths.
|
||||
*
|
||||
* Implementations should verify the IMountProviderArgs and return the
|
||||
* corresponding IMountPoint instances.
|
||||
*
|
||||
* @param string $path path for which the mounts are set up
|
||||
* @param IMountProviderArgs[] $mountProviderArgs
|
||||
* @param IStorageFactory $loader
|
||||
* @return array<string, IMountPoint> IMountPoint instances, indexed by
|
||||
* mount-point
|
||||
*/
|
||||
public function getMountsForPath(
|
||||
string $path,
|
||||
array $mountProviderArgs,
|
||||
IStorageFactory $loader,
|
||||
): array;
|
||||
}
|
||||
Loading…
Reference in New Issue