NFunctions.Generator 0.0.1-preview

This is a prerelease version of NFunctions.Generator.
dotnet add package NFunctions.Generator --version 0.0.1-preview                
NuGet\Install-Package NFunctions.Generator -Version 0.0.1-preview                
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="NFunctions.Generator" Version="0.0.1-preview" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NFunctions.Generator --version 0.0.1-preview                
#r "nuget: NFunctions.Generator, 0.0.1-preview"                
#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.
// Install NFunctions.Generator as a Cake Addin
#addin nuget:?package=NFunctions.Generator&version=0.0.1-preview&prerelease

// Install NFunctions.Generator as a Cake Tool
#tool nuget:?package=NFunctions.Generator&version=0.0.1-preview&prerelease                

NFunctions (alpha)

NFunctions is a C# open source serverless function framework that aims to free your code from AWS Lambda or Azure Functions boilerplate code while still leveraging those FaaS services.

You just use NFunctions agnostic attributes to tag your function handler methods and define their triggers. NFunctions source generator then automatically generates the AWS Lambda or Azure boilerplate code for you based on the NFunctions cloud provider NuGet package you've added to your project: NFunctions.AWS or NFunctions.Azure.

A typical NFunctions handler method looks like the below code. The NFunctions attribute tags your method as a function handler method. You can pass the name of the function to attribute. The HttpTrigger attribute defines that the function exectution is triggered by a GET http request.


    public class NFunctionsOnAWSLambda
    {
        [NFunctions("Get")]
        [HttpTrigger(NFunctions.Http.HttpMethod.GET, "api")]
        public HttpTriggerReponse MyFirstFunction(IHttpTriggerRequest request)
        {
            return new HttpTriggerReponse(System.Net.HttpStatusCode.OK, "Hello from NFunction");
        }

    }

Samples

In the samples folder, you have two sample projects that showcase that the same source code can be deployed seamlessly on AWS or Azure. You just have to open the NFunctionsSamples solution and build the projects. If you use Visual Studio 2022, you can use the AWS Toolkit extension to deploy on AWS or the built-in Azure tooling to deploy on Azure.

Source code

In the src folder, you have the NFunctions solution that you can use to explore and build the NFunctions NuGet packages.

Project status

This project is in its early stage. It aims at exploring the art of possible to abstract your serverless function code away from AWS Lambda and Azure Functions without sacrifiying to Kubernetes.

How to provide feedback

We are looking for feedback. Please, open an issue to record your feedback in our GitHub repository.

There are no supported framework assets in this 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
0.0.1-preview 48 9/26/2024