Documentation
¶
Index ¶
- func FindWasmFile(logger *slog.Logger) (string, error)
- func RequestToMap(r *http.Request) (map[string]any, error)
- func SHA256(input string) string
- func SHA256Bytes(input []byte) string
- func SHA256Reader(reader io.Reader) (string, error)
- func SetupLogger(handler slog.Handler, vmName string, groupName string) (slog.Handler, *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindWasmFile ¶
FindWasmFile searches for an Extism WASM file in various likely locations It searches in the current directory, project examples, and engines directories
Parameters:
- logger: Optional logger for verbose output
Returns:
- Absolute path to the found WASM file
- Error if no file is found with detailed information about searched paths
func RequestToMap ¶
RequestToMap converts an http.Request to a map[string]any using the httpRequest struct as an intermediary.
func SHA256Bytes ¶
func SetupLogger ¶
func SetupLogger( handler slog.Handler, vmName string, groupName string, ) (slog.Handler, *slog.Logger)
SetupLogger creates a properly configured logger for virtual machine 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 virtual machine (e.g., "starlark", "risor")
- groupName: Optional additional group name within the VM
Returns:
- The configured handler
- A logger created from the handler
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.