function

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Root = bootstrap.Root + ".function"
)

Variables

This section is empty.

Functions

func Default

func Default() string

Default returns the default cmd name from config.

func Name

func Name() string

Name returns func name

Types

type CmdFunc

type CmdFunc[T any] func(fn Handler[T]) *co.Command

CmdFunc defines a function that return a command.

type Function

type Function[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](m ...middleware.AnyErrorMiddleware[T]) (*Function[T], error)

func (*Function[T]) Run

func (f *Function[T]) Run(ctx context.Context, fn Handler[T], c ...CmdFunc[T]) error

Run runs fn through the adapter command the first argument names. With no command named, it runs the one boost.bootstrap.function.default names, or the only adapter given: an app wires the one adapter config chose, so it runs without arguments. It fails with NotValid when there is no adapter, or more than one and none is chosen, instead of printing the usage.

type Handler

type Handler[T any] func(context.Context, cloudevents.Event) (T, error)

func Wrapper

func Wrapper[T any](wrp *middleware.AnyErrorWrapper[T], fn Handler[T]) Handler[T]

Jump to

Keyboard shortcuts

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