Files
tiku-backend.net/Tiku.Application/Storage/IObjectStorageService.cs
xiong c497a3ca8d
Some checks failed
ci / release-gate (push) Has been cancelled
清理代码
2026-08-03 12:31:39 +08:00

37 lines
1.4 KiB
C#

namespace Tiku.Application.Storage;
public interface IObjectStorageService
{
string ConfiguredDefaultProvider();
string ConfiguredDefaultBucket();
string NormalizeProvider(string? value, string? fallback = null);
string ValidateObjectKey(Guid tenantId, string objectKey);
string ValidateMimeType(string mimeType);
long? ValidateFileSize(long? fileSizeBytes);
void AssertUploadProvider(string provider);
void AssertWritableLocation(StorageAssetLocation location);
Task<ObjectStorageSignedUrl> SignUploadAsync(
ObjectStorageUploadSignRequest request,
CancellationToken cancellationToken = default);
Task<ObjectStorageSignedUrl> SignDownloadAsync(
ObjectStorageDownloadSignRequest request,
CancellationToken cancellationToken = default);
Task<ObjectStorageWriteResult> WriteObjectAsync(
ObjectStorageWriteRequest request,
CancellationToken cancellationToken = default);
Task<ObjectStorageMetadata> HeadObjectAsync(
ObjectStorageHeadRequest request,
CancellationToken cancellationToken = default);
Task<Stream> OpenReadAsync(
ObjectStorageReadRequest request,
CancellationToken cancellationToken = default)
{
return Task.FromException<Stream>(
new NotSupportedException("Object storage read streaming is not configured."));
}
}