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 ¶
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.
Click to show internal directories.
Click to hide internal directories.