registry

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v1.6.0

type Option func(*RegisteredFunction)

Option is an option used when registering a function.

func WithName added in v1.7.0

func WithName(name string) Option

func WithPath added in v1.6.0

func WithPath(path string) Option

type RegisteredFunction

type RegisteredFunction struct {
	Name         string                                         // The name of the function
	Path         string                                         // The serving path of the function
	CloudEventFn func(context.Context, cloudevents.Event) error // Optional: The user's CloudEvent function
	HTTPFn       func(http.ResponseWriter, *http.Request)       // Optional: The user's HTTP function
	EventFn      interface{}                                    // Optional: The user's Event function
	TypedFn      interface{}                                    // Optional: The user's typed function
}

RegisteredFunction represents a function that has been registered with the registry.

type Registry added in v1.5.0

type Registry struct {
	// contains filtered or unexported fields
}

Registry is a registry of functions.

func Default added in v1.5.0

func Default() *Registry

Default returns the default, singleton registry instance.

func New added in v1.5.0

func New() *Registry

func (*Registry) GetAllFunctions added in v1.6.0

func (r *Registry) GetAllFunctions() []*RegisteredFunction

GetAllFunctions returns all the registered functions.

func (*Registry) GetLastFunctionWithoutName added in v1.7.0

func (r *Registry) GetLastFunctionWithoutName() *RegisteredFunction

GetLastFunctionWithoutName returns the last function that's not registered declaratively. As the function is registered without a name, it can not be found by setting FUNCTION_TARGET when deploying. In this case, the last function that's not registered declaratively will be served.

func (*Registry) GetRegisteredFunction added in v1.5.0

func (r *Registry) GetRegisteredFunction(name string) (*RegisteredFunction, bool)

GetRegisteredFunction a registered function by name

func (*Registry) RegisterCloudEvent added in v1.5.0

func (r *Registry) RegisterCloudEvent(fn func(context.Context, cloudevents.Event) error, options ...Option) error

RegisterCloudEvent registers a CloudEvent function.

func (*Registry) RegisterEvent added in v1.6.0

func (r *Registry) RegisterEvent(fn interface{}, options ...Option) error

RegisterEvent registers an Event function.

func (*Registry) RegisterHTTP added in v1.5.0

func (r *Registry) RegisterHTTP(fn func(http.ResponseWriter, *http.Request), options ...Option) error

RegisterHTTP registes a HTTP function.

func (*Registry) RegisterTyped added in v1.7.0

func (r *Registry) RegisterTyped(fn interface{}, options ...Option) error

RegisterTyped registers a strongly typed function.

func (*Registry) Reset added in v1.7.0

func (r *Registry) Reset()

Jump to

Keyboard shortcuts

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