helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestToMap

func RequestToMap(r *http.Request) (map[string]any, error)

RequestToMap converts an http.Request to a map[string]any using the httpRequest struct as an intermediary.

func SHA256

func SHA256(input string) string

func SHA256Bytes

func SHA256Bytes(input []byte) string

func SHA256Reader

func SHA256Reader(reader io.Reader) (string, error)

func SetupLogger

func SetupLogger(
	handler slog.Handler,
	engineName string,
	groupName string,
) (slog.Handler, *slog.Logger)

SetupLogger creates a properly configured logger for script engine implementations. If the provided handler is nil, it creates a default handler with appropriate grouping.

Parameters:

  • handler: The slog.Handler to use, or nil for defaults
  • vmName: The name of the script engine (e.g., "starlark", "risor")
  • groupName: Optional additional group name within the engine

Returns:

  • The configured handler
  • A logger created from the handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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