function

package
v1.0.0-dev.110 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 10 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

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