runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package runtime provides helpers for krate Go API route handlers. Import it as

runtime "github.com/kratejs/krate/packages/compiler/goext/runtime"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, status int, msg string)

Error writes a JSON error response.

func Serve

func Serve(mux *http.ServeMux)

Serve starts the API server and blocks until the process receives a termination signal. It listens on the AF_UNIX socket in KRATE_GOAPI_SOCKET when set (the main server dials it over UDS), otherwise on the KRATE_GOAPI_PORT loopback port.

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v interface{})

WriteJSON writes v as a JSON response with the given status code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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