funcframework

package
Version: v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 31

Documentation

Overview

Package funcframework is a Functions Framework implementation for Go. It allows you to register HTTP and event functions, then start an HTTP server serving those functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCloudEventFunctionContext added in v1.1.0

func RegisterCloudEventFunctionContext(ctx context.Context, path string, fn func(context.Context, cloudevents.Event) error) error

RegisterCloudEventFunctionContext registers fn as an cloudevent function.

func RegisterEventFunction

func RegisterEventFunction(path string, fn interface{})

RegisterEventFunction registers fn as an event function. Maintained for backward compatibility. Please use RegisterEventFunctionContext instead.

func RegisterEventFunctionContext added in v1.1.0

func RegisterEventFunctionContext(ctx context.Context, path string, fn interface{}) error

RegisterEventFunctionContext registers fn as an event function. The function must have two arguments, a context.Context and a struct type depending on the event, and return an error. If fn has the wrong signature, RegisterEventFunction returns an error.

func RegisterHTTPFunction

func RegisterHTTPFunction(path string, fn interface{})

RegisterHTTPFunction registers fn as an HTTP function. Maintained for backward compatibility. Please use RegisterHTTPFunctionContext instead.

func RegisterHTTPFunctionContext added in v1.1.0

func RegisterHTTPFunctionContext(ctx context.Context, path string, fn func(http.ResponseWriter, *http.Request)) error

RegisterHTTPFunctionContext registers fn as an HTTP function.

func Start

func Start(port string) error

Start serves an HTTP server with registered function(s).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL