runtime

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package runtime provides the runtime for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Runtime)

Option defines a function type used to configure a Runtime instance during initialization.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger for the Runtime instance, enabling structured logging for runtime processes.

type Runtime

type Runtime struct {
	*handler.Handler
	// contains filtered or unexported fields
}

Runtime represents the execution context integrating the handler and logger for processing runtime events.

func NewRuntime

func NewRuntime(handler *handler.Handler, opts ...Option) *Runtime

NewRuntime creates a new runtime instance.

func (*Runtime) Lambda

func (r *Runtime) Lambda(req models.Request) (response any, err error)

Lambda is the entrypoint function when the `--mode lambda` flag is set.

func (*Runtime) LambdaForEvent

func (r *Runtime) LambdaForEvent(event map[string]any) (any, error)

LambdaForEvent is the entrypoint function when the `--mode lambda-event` flag is set.

func (*Runtime) Service

func (r *Runtime) Service(rw http.ResponseWriter, req *http.Request)

Service is the entrypoint function when the `--mode service` flag is set.

Jump to

Keyboard shortcuts

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