# Packages
Package defaultexts are the extensions that are auto-loaded in to the default fnserver binary included here as a package to simplify inclusion in testing.
# Functions
AppIDFromContext returns the app from a context, if set.
No description provided by the author
No description provided by the author
No description provided by the author
EnableShutdownEndpoint adds /shutdown to initiate a shutdown of an fn server.
FnIDFromContext returns the app from a context, if set.
HandleErrorResponse used to handle response errors in the same way.
LimitRequestBody wraps every http request to limit its size to the specified max bytes.
New creates a new Functions server with the opts given.
NewFromEnv creates a new Functions server based on env vars.
NewRequestBasedFnAnnotator creates a FnAnnotator that inspects the incoming request host and port, and uses this to generate fn invoke endpoint URLs based on those.
NewRequestBasedTriggerAnnotator creates a TriggerAnnotator that inspects the incoming request host and port, and uses this to generate http trigger endpoint URLs based on those.
NewStaticURLFnAnnotator annotates triggers bases on a given, specified URL base - e.g.
NewStaticURLTriggerAnnotator annotates triggers bases on a given, specified URL base - e.g.
No description provided by the author
RegisterExtension registers the extension so it's available, but does not initialize it.
WithAdminEnabled enables or disables the Admin server.
WithAdminServer starts the admin server on the specified port.
WithAgent allows directly setting an agent.
WithAgentFromEnv must be provided as the last server option because it relies on all other options being set first.
WithDatastore allows directly setting a datastore.
WithDBURL maps EnvDBURL.
WithExtraCtx appends a context to the list of contexts the server will watch for cancellations / errors / signals.
WithFnAnnotator adds a fnEndpoint provider to the server.
WithFullAgent is a shorthand for WithAgent(..
WithGRPCPort maps EnvGRPCPort.
WithHTTPConfig allows configuring specific http servers.
WithJaeger maps EnvJaegerURL.
WithLogDest maps EnvLogDest TODO(deprecate): caller should just call SetLogDest.
WithLogFormat maps EnvLogFormat TODO(deprecate): caller should just call SetLogFormat.
WithLogLevel maps EnvLogLevel TODO(deprecate): caller should just call WithLogLevel.
WithoutFnInvokeEndpoints optionally disables the fn direct invoke endpoints from a LB -supporting server, allowing extensions to replace them with their own versions.
WithoutHTTPTriggerEndpoints optionally disables the trigger and route endpoints from a LB -supporting server, allowing extensions to replace them with their own versions.
WithoutProfilerEndpoints disables the /debug endpoints.
WithPrometheus activates the prometheus collection and /metrics endpoint.
WithReadDataAccess overrides the LB read DataAccess for a server.
WithRIDProvider will generate request ids for each http request using the given generator.
WithTLS configures a service with a provided TLS configuration.
WithTriggerAnnotator adds a trigggerEndpoint provider to the server.
WithType maps EnvNodeType.
WithWebEnabled enables or disables the web server.
WithWebPort maps EnvPort.
WithZipkin maps EnvZipkinURL.
WriteError easy way to do standard error response, but can set statuscode and error message easier than handleErrorResponse.
# Constants
Configuration keys to identify grpc, admin, web services:.
DefaultGRPCPort is 9190.
DefaultLogDest is stderr.
DefaultLogFormat is text.
DefaultLogLevel is info.
DefaultPort is 8080.
EnvAPICORSHeaders is the list of CORS headers allowed.
EnvAPICORSOrigins is the list of CORS origins to allow.
EnvDBURL is a url to a db service: possible schemes: { postgres, sqlite3, mysql }.
EnvGRPCPort is the port to run the grpc server on for a pure-runner node.
EnvHTTPIdleTimeout maximum amount of time to wait for the next request.
EnvJaegerURL is the url of a jaeger node to send traces to.
EnvLBPlacementAlg is the algorithm to place fn calls to fn runners in lb.[0w.
EnvLogDest is a url of a log destination: possible schemes: { udp, tcp, file } file url must contain only a path, syslog must contain only a host[:port] expect: [scheme://][host][:port][/path] default scheme to udp:// if none given.
EnvLogFormat sets the stderr logging format, text or json only.
EnvLogLevel sets the stderr logging level.
EnvLogPrefix is a prefix to affix to each log line.
EnvMaxHeaderSize sets the limit in bytes for any API request body's length.
EnvMaxRequestSize sets the limit in bytes for any API request body's length.
EnvNodeType defines the runtime mode for fn to run in, options are one of: { full, api, lb, runner, pure-runner }.
be careful, Gin expects this variable to be "port".
EnvProcessCollectorList is the list of procid's to collect metrics for.
EnvPublicLoadBalancerURL is the url to inject into trigger responses to get a public url.
EnvReadHeaderTimeout sets the timeout limit for reading a http request header.
EnvReadTimeout sets the timeout limit for reading a http request body.
EnvRIDHeader is the header name of the incoming request which holds the request ID.
EnvRunnerAddresses is a list of runner urls for an lb to use.
EnvRunnerURL is a url pointing to an Fn API service.
EnvWriteTimeout sets the timeout limit for writing a http response.
EnvZipkinURL is the url of a zipkin node to send traces to.
Configuration keys to identify grpc, admin, web services:.
ServerTypeAPI runs only control plane endpoints, to manage resources.
ServerTypeFull runs all API endpoints, including executing tasks.
ServerTypeLB runs only invoke/http trigger endpoints, routing to runner nodes.
ServerTypePureRunner runs only grpc server, to execute tasks.
Configuration keys to identify grpc, admin, web services:.
For backwards compat, TLS-prefix configuration-keys:.
Configuration keys to identify grpc, admin, web services:.
Configuration keys to identify grpc, admin, web services:.
# Variables
No description provided by the author
ErrInternalServerError returned when something exceptional happens.
# Structs
RIDProvider is used to generate request IDs.
Server is the object which ties together all the fn things, it is the entrypoint for managing fn resources and executing tasks.
# Interfaces
FnAnnotator Is used to inject trigger context (such as request URLs) into outbound trigger resources.
ResponseBuffer implements http.ResponseWriter.
TriggerAnnotator Is used to inject trigger context (such as request URLs) into outbound trigger resources.