lambda

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start[E any](handler Handler[E], middlewares []middleware.NoResponse[E], sigTermCallbacks ...func())

Start initiates a lambda container for a handler and middleware of events that do not return a response. sigTermCallbacks are callbacks to be triggered when the lambda container is closed.

func StartWithResponse

func StartWithResponse[E, R any](handler HandlerWithResponse[E, R], middlewares []middleware.WithResponse[E, R], sigTermCallbacks ...func())

StartWithResponse initiates a lambda container for a handler and middleware of events that return a response type R. sigTermCallbacks are callbacks to be triggered when the lambda container is closed.

Types

type Handler

type Handler[E any] interface {
	// Handle handles an event.
	Handle(ctx context.Context, event E) error
}

Handler [E any] interface should be implemented for handlers of event type E that do not return a response.

type HandlerWithResponse

type HandlerWithResponse[E, R any] interface {
	// Handle handles an event and returns a response.
	Handle(ctx context.Context, event E) (R, error)
}

HandlerWithResponse [E, R any] interface should be implemented for handlers of event type E that return a response type R.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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