domain

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package domain provides E2B-compatible domain conversion utilities. It maps AgentBox domain 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 *apidomain.Sandbox, pool *agentsv1alpha1.SandboxPool) e2bgen.ListedSandbox

ToE2BListedSandbox converts an AgentBox domain.Sandbox directly to an e2bgen.ListedSandbox.

func ToE2BSandbox

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

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

func ToE2BSandboxDetail

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

ToE2BSandboxDetail converts an AgentBox domain.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