domain

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package domain provides E2B-compatible conversion utilities. It maps AgentBox native API models directly to E2B generated types.

Index

Constants

View Source
const (
	// EnvdVersion is the fixed envd version reported in E2B API responses.
	// E2B SDK validates that this field is present and non-empty.
	EnvdVersion = "0.1.0"
)

Variables

This section is empty.

Functions

func BuildE2BEndpointURL

func BuildE2BEndpointURL(scheme, gatewayDomain, sandboxID string, port int32) string

BuildE2BEndpointURL builds the E2B-style connection URL for a sandbox. Uses the private path protocol: scheme://domain/agentbox/<sandboxID>/<port>

func ExtractCPUFromQuantity

func ExtractCPUFromQuantity(q resource.Quantity) int32

ExtractCPUFromQuantity converts a resource.Quantity to an int32 CPU count.

func ExtractMemoryMBFromQuantity

func ExtractMemoryMBFromQuantity(q resource.Quantity) int64

ExtractMemoryMBFromQuantity converts a resource.Quantity to int64 MB.

func IsValidSandboxID

func IsValidSandboxID(id string) bool

IsValidSandboxID returns true if the sandbox ID matches the expected format.

func SandboxStateFromStatus

func SandboxStateFromStatus(status string) string

SandboxStateFromStatus maps AgentBox sandbox status to E2B state. E2B only has "running" and "paused" states.

func ToE2BListedSandbox

func ToE2BListedSandbox(sb *gen.Sandbox, pool *agentsv1alpha1.SandboxPool) e2bgen.ListedSandbox

ToE2BListedSandbox converts a native gen.Sandbox directly to an e2bgen.ListedSandbox.

func ToE2BSandbox

func ToE2BSandbox(sb *gen.Sandbox, pool *agentsv1alpha1.SandboxPool, gatewayDomain string) e2bgen.Sandbox

ToE2BSandbox converts a native gen.Sandbox + SandboxPool directly to an e2bgen.Sandbox. gatewayDomain is the gateway domain name used to build connection URLs.

func ToE2BSandboxDetail

func ToE2BSandboxDetail(sb *gen.Sandbox, pool *agentsv1alpha1.SandboxPool, gatewayDomain string) e2bgen.SandboxDetail

ToE2BSandboxDetail converts a native gen.Sandbox + SandboxPool to an e2bgen.SandboxDetail. gatewayDomain is the gateway domain name used to build connection URLs.

func ToE2BTemplate

func ToE2BTemplate(pool *agentsv1alpha1.SandboxPool) e2bgen.Template

ToE2BTemplate converts an AgentBox SandboxPool directly to an e2bgen.Template.

Types

This section is empty.

Jump to

Keyboard shortcuts

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