daytona

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 26 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 *http.ServeMux, d Deps)

RegisterRoutes mounts the supported Daytona compatibility surface.

Types

type BuildConfig

type BuildConfig struct {
	ContextEnabled bool
	Timeout        time.Duration
}

BuildConfig surfaces the operator-configured image-build knobs through to the facade. Mirrors the corresponding fields on internal/config.Config — kept narrow so the package doesn't take a dep on internal/config.

type Deps

type Deps struct {
	Service *service.Service
	Logger  *slog.Logger
	Auth    func(http.Handler) http.Handler
	// Builder is optional. When nil, multi-line Dockerfile builds are
	// rejected at the handler with a 400 — the legacy single-line `FROM`
	// fast-path still works (it doesn't need a builder).
	Builder ImageBuilder
	Build   BuildConfig
	// ContainerEngine selects BuildKit-absent clear errors on containerd hosts.
	ContainerEngine string
}

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

type ImageBuilder

type ImageBuilder interface {
	BuildImage(ctx context.Context, req docker.BuildImageRequest) error
	ImageExists(ctx context.Context, imageRef string) (bool, error)
	RemoveImage(ctx context.Context, imageRef string) error
	// RefreshTag bumps Docker's Metadata.LastTagTime so the built-image
	// janitor doesn't GC a tag we just handed back from the cache. Called
	// on the ImageExists==true short-circuit in resolveBuildInfo.
	RefreshTag(ctx context.Context, fullRef string) error
}

ImageBuilder is the slice of pkg/docker.Client the facade needs to turn a Dockerfile into a runnable image. Declared as an interface so the test harness can stub it without standing up a real Docker daemon.

Jump to

Keyboard shortcuts

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