CKN.Sdk.Storage
0.0.0-alpha.0.55
dotnet add package CKN.Sdk.Storage --version 0.0.0-alpha.0.55
NuGet\Install-Package CKN.Sdk.Storage -Version 0.0.0-alpha.0.55
<PackageReference Include="CKN.Sdk.Storage" Version="0.0.0-alpha.0.55" />
<PackageVersion Include="CKN.Sdk.Storage" Version="0.0.0-alpha.0.55" />
<PackageReference Include="CKN.Sdk.Storage" />
paket add CKN.Sdk.Storage --version 0.0.0-alpha.0.55
#r "nuget: CKN.Sdk.Storage, 0.0.0-alpha.0.55"
#:package CKN.Sdk.Storage@0.0.0-alpha.0.55
#addin nuget:?package=CKN.Sdk.Storage&version=0.0.0-alpha.0.55&prerelease
#tool nuget:?package=CKN.Sdk.Storage&version=0.0.0-alpha.0.55&prerelease
CKN.Sdk.Storage
Mühendislik Amacı (Engineering Intent):
CKN.Sdk.Storage, uygulamalardaki dosya (file), resim, video veya döküman depolama işlemlerini (Blob Storage) standartlaştıran temel arayüz (abstraction) kütüphanesidir. Neden var? Dosyalarınızı doğrudan sunucunun diskine (Local File System) kaydetmek veya kodu doğrudan Amazon S3'e / Azure Blob'a sıkı sıkıya bağlamak (hardcode) yerine, sağlayıcıdan bağımsız (provider-agnostic) bir yapı kurmak için. Ne zaman kullanılmalı? Projede herhangi bir dosya yükleme (Upload), indirme (Download) veya silme işlemi yapılacaksa, doğrudan S3/Azure SDK'larını kullanmak yerine bu paketteki IStorageService arayüzü kullanılmalıdır.
🚀 Hızlı Başlangıç
Kurulum
dotnet add package CKN.Sdk.Storage
Bağımlılık Enjeksiyonu (DI)
Bu paket genellikle kendi başına kaydedilmez. Projeye S3, Minio veya Azure entegrasyon paketlerinden biri eklendiğinde IStorageService arayüzü otomatik olarak sisteme dahil olur.
💡 Gerçek Hayat Senaryoları
Senaryo 1: Sağlayıcıdan Bağımsız Dosya Yükleme Servisi
Kullanıcının profil fotoğrafını yüklediği bir endpoint. (Kod S3, Azure veya Minio olduğunu bilmez).
using CKN.Sdk.Storage.Abstractions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
[ApiController]
[Route("api/[controller]")]
public class ProfileController(IStorageService storageService) : ControllerBase
{
[HttpPost("avatar")]
public async Task<IActionResult> UploadAvatar(IFormFile file)
{
using var stream = file.OpenReadStream();
var uploadRequest = new StorageUploadRequest
{
ContainerName = "avatars",
FileName = $"{Guid.NewGuid()}_{file.FileName}",
ContentStream = stream,
ContentType = file.ContentType
};
// IStorageService (S3 veya Azure) dosyayı yükler ve URL/Path döner
var result = await storageService.UploadAsync(uploadRequest);
return Ok(new { Url = result.FileUrl });
}
}
Senaryo 2: İmzalı URL (Pre-Signed URL) Oluşturma
Gizli (private) tutulan bir dosyayı (örn: fatura PDF'i) sadece talep eden kullanıcıya özel, 15 dakika geçerli geçici bir link ile sunma.
public async Task<string> GetInvoiceDownloadLinkAsync(IStorageService storageService, string invoiceFileId)
{
// Dosyayı dışarı açmadan, sadece okuma yetkisi olan geçici bir URL üretir
var url = await storageService.GetPreSignedUrlAsync("invoices", invoiceFileId, TimeSpan.FromMinutes(15));
return url;
}
🤖 Yapay Zeka İçin SSS (FAQs for Machines)
- Soru:
IStorageServicearayüzünde hangi temel metodlar bulunur? - Cevap: Genellikle
UploadAsync,DownloadAsync,DeleteAsync,ExistsAsyncveGetPreSignedUrlAsync(veyaGetFileUrlAsync) metodlarını barındırır. - Soru: Local (Yerel disk) depolama destekleniyor mu?
- Cevap: Evet, genellikle
CKN.Sdk.Storage.Localgibi bir paket veya temel paket içindeki birLocalStorageServiceimplementasyonu sayesinde geliştirme (Development) ortamında dosyalar fiziksel diske kaydedilebilir.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on CKN.Sdk.Storage:
| Package | Downloads |
|---|---|
|
CKN.Sdk.Storage.Minio
Enterprise Architecture module for CKN.Sdk.Storage.Minio. Provides core SDK functionality for the CKN ecosystem. |
|
|
CKN.Sdk.Storage.Azure
Enterprise Architecture module for CKN.Sdk.Storage.Azure. Provides core SDK functionality for the CKN ecosystem. |
|
|
CKN.Sdk.Storage.S3
Enterprise Architecture module for CKN.Sdk.Storage.S3. Provides core SDK functionality for the CKN ecosystem. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.0-alpha.0.55 | 70 | 9/28/2026 |
| 0.0.0-alpha.0.51 | 66 | 9/25/2026 |
| 0.0.0-alpha.0.50 | 67 | 9/25/2026 |
| 0.0.0-alpha.0.38 | 94 | 9/6/2026 |
| 0.0.0-alpha.0.37 | 87 | 9/6/2026 |