daytona

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathPrefix    = "/daytona"
	ToolboxPrefix = PathPrefix + "/toolbox"
)

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(mux apihttp.Mux, d Deps)

RegisterRoutes mounts the supported Daytona compatibility surface.

Types

type Deps

type Deps struct {
	Service *service.Service
	Logger  *slog.Logger
	// Auth authenticates a request (pkg/api). Routes never call it
	// directly: Route composes it with the permission check.
	Auth func(http.Handler) http.Handler
	// Audit is the seam task T5 fills with kind "api" records
	// (apihttp.AuditHook). nil records nothing.
	Audit apihttp.AuditHook
	// ContainerEngine selects BuildKit-absent clear errors on containerd hosts.
	ContainerEngine string
	// DefaultImage is the image a create falls back to when the request names
	// neither a snapshot nor a build (SB_DAYTONA_DEFAULT_IMAGE, read once in
	// config). Empty falls back to the built-in default.
	DefaultImage string
	// ListGate bounds the cluster-wide lists this node runs at once
	// (clusterlist.Admit); nil admits every list. One gate is shared by v1
	// and every facade: they cost the same fan-out.
	ListGate *apihttp.Gate
}

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

func (Deps) Route added in v0.6.8

func (d Deps) Route(perm controlplane.Permission, h http.Handler) http.Handler

Route returns h behind authenticate → authorize(perm) → audit seam (plans/identity-and-access.md §5.3).

func (Deps) RouteBy added in v0.6.8

func (d Deps) RouteBy(tag string, classify func(*http.Request) controlplane.Permission, h http.Handler) http.Handler

RouteBy is Route for a route whose permission depends on the request.

type ToolboxCall added in v0.6.12

type ToolboxCall struct {
	Method string
	Path   string
	Prefix bool
}

ToolboxCall is one toolboxd request a facade makes: a method (empty for any) and a path, which is a prefix when Prefix is set.

func ToolboxCalls added in v0.6.12

func ToolboxCalls() []ToolboxCall

ToolboxCalls lists every toolboxd request this facade can make, derived from the dispatch table above.

Jump to

Keyboard shortcuts

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