# README
Go FDK Documentation
This is documentation for the Go function development kit (FDK) which provides convenience functions for writing Go Fn code.
For getting started using the Go FDK , see the tutorial here.
To get the Go FDK simply import it in your program github.com/fnproject/fdk-go
, and use go get
to get it.
User Information
- See the Fn Quickstart for sample commands.
- Detailed installation instructions.
- Configure your CLI Context.
- For a list of commands see Fn CLI Command Guide and Reference.
- For general information see Fn docs and tutorials.
Go FDK Development
See CONTRIBUTING for information on contributing to the project.
# Functions
AddHeader will add a header onto the function response.
GetContext will return an fdk Context that can be used to read configuration and request information from an incoming request.
Handle will run the event loop for a function.
HandleContext works the same as Handle, but takes a context that will exit the handler loop when canceled/timed out.
HTTPHandler makes a Handler from an http.Handler, if the function invocation is from an http trigger the request is identical to the client request to the http gateway (sans some hop headers).
SetHeader will set a header on the function response.
WithContext adds an fn context to a context context.
WriteStatus will set the status code to return in the function response.
# Constants
Version is the FDK version.
# Interfaces
Context contains all configuration for a function invocation.
Handler is a function handler, representing 1 invocation of a function.
HTTPContext contains all configuration for a function invocation sourced from an http gateway trigger, which will make the function appear to receive from the client request they were sourced from, with no additional headers.
TracingContext contains all configuration for a function invocated to get the tracing context data.
# Type aliases
HandlerFunc makes a Handler so that you don't have to!.