e2bcompat

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package e2bcompat provides an E2B-compatible HTTP API server for AgentBox. It runs on an independent port and maps E2B SDK calls to AgentBox operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BindAddress is the TCP address the HTTP server listens on (e.g. ":8090").
	BindAddress string
	// Domain is the gateway domain name returned to SDK clients for building
	// connection URLs. Can be a hostname (e.g. "my.gateway.com") or host:port.
	// When empty, the domain field in API responses will be null.
	Domain string
	// ServerVersion is stamped on every response via X-AgentBox-Server-Version.
	ServerVersion string
}

Config holds the configuration for the E2B-compatible API server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the E2B-compatible HTTP API server.

func New

func New(cfg Config, k8sClient client.Client,
	keyStore apikey.KeyStore, adminKeyMgr *apikey.AdminKeyManager, iamSvc service.IAMService,
	sandboxSvc service.SandboxService, forwarder *service.CrossClusterForwarder) *Server

New creates and configures the E2B-compatible HTTP server. keyStore, adminKeyMgr, and iamSvc are shared with the native API server so that both servers validate keys against the same store without duplicating the Secret-backed cache. sandboxSvc is the shared SandboxService instance; passing the same instance avoids duplicate per-pool scheduler goroutines and ensures a single Shutdown path.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start runs the server until ctx is cancelled, then gracefully shuts down.

Directories

Path Synopsis
Package domain provides E2B-compatible domain conversion utilities.
Package domain provides E2B-compatible domain conversion utilities.
Package e2bgen provides primitives to interact with the openapi HTTP API.
Package e2bgen provides primitives to interact with the openapi HTTP API.
Package handlers implements the E2B-compatible StrictServerInterface generated by oapi-codegen.
Package handlers implements the E2B-compatible StrictServerInterface generated by oapi-codegen.
Package router provides E2B-compatible HTTP route registration.
Package router provides E2B-compatible HTTP route registration.
middleware
Package middleware provides E2B-compatible authentication middleware.
Package middleware provides E2B-compatible authentication middleware.

Jump to

Keyboard shortcuts

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