♻️ Extract the Storage service to DysonNetwork.Drive microservice
This commit is contained in:
27
DysonNetwork.Drive/Interfaces/IFileService.cs
Normal file
27
DysonNetwork.Drive/Interfaces/IFileService.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using DysonNetwork.Drive.Models;
|
||||
|
||||
namespace DysonNetwork.Drive.Interfaces;
|
||||
|
||||
public interface IFileService
|
||||
{
|
||||
Task<CloudFile> GetFileAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<Stream> DownloadFileAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> UploadFileAsync(Stream fileStream, string fileName, string contentType, IDictionary<string, string>? metadata = null, CancellationToken cancellationToken = default);
|
||||
Task<bool> DeleteFileAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> UpdateFileMetadataAsync(Guid fileId, IDictionary<string, string> metadata, CancellationToken cancellationToken = default);
|
||||
Task<bool> FileExistsAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<string> GetFileUrlAsync(Guid fileId, TimeSpan? expiry = null, CancellationToken cancellationToken = default);
|
||||
Task<string> GetFileThumbnailUrlAsync(Guid fileId, int? width = null, int? height = null, TimeSpan? expiry = null, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> CopyFileAsync(Guid sourceFileId, string? newName = null, IDictionary<string, string>? newMetadata = null, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> MoveFileAsync(Guid sourceFileId, string? newName = null, IDictionary<string, string>? newMetadata = null, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> RenameFileAsync(Guid fileId, string newName, CancellationToken cancellationToken = default);
|
||||
Task<long> GetFileSizeAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<string> GetFileHashAsync(Guid fileId, CancellationToken cancellationToken = default);
|
||||
Task<Stream> GetFileThumbnailAsync(Guid fileId, int? width = null, int? height = null, CancellationToken cancellationToken = default);
|
||||
Task<CloudFile> SetFileVisibilityAsync(Guid fileId, bool isPublic, CancellationToken cancellationToken = default);
|
||||
}
|
Reference in New Issue
Block a user