runloop

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package runloop is a compatibility facade for the official Runloop SDKs (@runloop/api-client, runloop_api_client). Pointing RUNLOOP_BASE_URL at https://<host>/runloop makes the SDK's /v1/devboxes/... calls land here, where they are translated onto internal/service the same way the /e2b and /daytona facades are. Devboxes are native sandboxes; executions and file calls go through the sandbox toolbox.

Index

Constants

View Source
const PathPrefix = "/runloop"

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(mux *http.ServeMux, d Deps)

RegisterRoutes mounts the facade. Routing below /v1/devboxes is done by hand rather than with ServeMux patterns: Runloop puts literal segments (create_and_await_running, disk_snapshots, evictions) where devbox ids go, and ServeMux panics at registration on pairs such as "POST .../disk_snapshots/{sid}" vs "POST .../{id}/shutdown", which match the same path with neither more specific.

func WriteError

func WriteError(w http.ResponseWriter, status int, message string)

WriteError writes the Runloop error body. Both SDKs retry 408, 409, 429 and every 5xx up to five times with backoff, POSTs included, so a status in that set that retrying cannot fix carries x-should-retry: false. Without it a 501 or a permanent conflict costs the caller ~30s of pointless retries before the error surfaces.

Types

type Deps

type Deps struct {
	Service *service.Service
	Logger  *slog.Logger
	Auth    func(http.Handler) http.Handler
	// BlueprintMapJSON maps blueprint names/ids → images
	// (SB_RUNLOOP_BLUEPRINT_MAP_JSON), read once in config; the facade parses
	// it and applies its own defaults.
	BlueprintMapJSON string
}

Deps are the shared dependencies the Runloop facade needs from the top-level API package.

Jump to

Keyboard shortcuts

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