BeeQ.FileStorage.GoogleCloud 1.0.0

dotnet add package BeeQ.FileStorage.GoogleCloud --version 1.0.0
                    
NuGet\Install-Package BeeQ.FileStorage.GoogleCloud -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BeeQ.FileStorage.GoogleCloud" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BeeQ.FileStorage.GoogleCloud" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BeeQ.FileStorage.GoogleCloud" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BeeQ.FileStorage.GoogleCloud --version 1.0.0
                    
#r "nuget: BeeQ.FileStorage.GoogleCloud, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BeeQ.FileStorage.GoogleCloud@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BeeQ.FileStorage.GoogleCloud&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BeeQ.FileStorage.GoogleCloud&version=1.0.0
                    
Install as a Cake Tool

BeeQ.FileStorage.GoogleCloud

A lightweight file storage adapter that integrates Google Cloud Storage with the BeeQ FileStorage abstractions.

This library provides a simple, opinionated implementation of IFileStorage backed by Google Cloud Storage. It exposes convenient methods for uploading, downloading, copying and listing objects, creating and managing buckets, and generating temporary signed URLs.

Features

  • Pluggable configuration (credentials, encryption keys, custom path templates)
  • Support for custom identifier types (generic <TId>)
  • Helper methods for bucket and object management
  • Generates temporary signed URLs for direct downloads

Installation

Install the NuGet package (publish name: BeeQ.FileStorage.GoogleCloud):

dotnet add package BeeQ.FileStorage.GoogleCloud

Quick start

Register the Google Cloud implementation using the provided builder extensions. The examples assume you are configuring a BeeQ file storage builder in your application startup code.

Using the default Guid identifier:

builder.UseGoogleCloud("my-schema", options =>
{
	options.BasePath = "files"; // optional if PathTemplate is provided
	options.Credentials = GoogleCredential.FromFile("path/to/service-account.json");
	// optional: options.EncryptionKey = new EncryptionKey(...);
});

Using a custom identifier type TId:

builder.UseGoogleCloud<long>("my-schema", options =>
{
	options.BasePath = "files";
	options.OnCreateId = async ctx => {
		// return new id for created object
		return await Task.FromResult(GenerateIdFrom(ctx.Filename));
	};
});

Common operations

  • Upload a stream: Use the IFileStorage.Upload methods provided by the BeeQ abstractions. The adapter will use configured options to build object keys and upload using the Google Cloud client.
  • Download a stream: Use IFileStorage.Get or the adapter's GetTemporalyUrl to generate a signed URL for direct download.
  • Bucket management: CreateBucket, GetBucket, GetBuckets, DeleteBucket and DeleteBucketWithFiles are available on IGoogleCloudService to manage buckets programmatically.

Configuration details

  • StorageClientBuilder: Provide a StorageClientBuilder to customize client creation (useful for emulators or custom endpoints).
  • Credentials: Supply a GoogleCredential (for example from a service account JSON file) or rely on default application credentials.
  • EncryptionKey: Optional customer-supplied encryption key for object-level encryption.
  • BasePath vs PathTemplate: Either set a BasePath (string) or provide a PathTemplate function to control how object names are derived from file identifiers.
  • OnCreateId: Required when using a non-Guid identifier type to generate ids for newly created objects.

Permissions and signing

To generate signed URLs (GetTemporalyUrl), the configured credentials must allow signing. For service accounts this normally requires permissions such as iam.serviceAccounts.signBlob or using a Storage client with signing enabled.

Notes

  • This library is an adapter and depends on the Google Cloud Storage client libraries. Ensure your runtime environment has network access to Google Cloud or to the configured emulator.
  • Exceptions thrown by the library are documented and represent configuration issues (for example, missing BasePath or missing OnCreateId for non-Guid TId).

Contributing

Contributions, bug reports and pull requests are welcome. Please follow the repository guidelines and keep changes focused and well-tested.

License

This project is licensed under the terms found in the repository LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 81 9/8/2026