Documentation
¶
Overview ¶
Package domain provides E2B-compatible domain conversion utilities. It maps AgentBox domain models directly to E2B generated types.
Index ¶
- Constants
- func BuildE2BEndpointURL(scheme, gatewayDomain, sandboxID string, port int32) string
- func ExtractCPUFromQuantity(q resource.Quantity) int32
- func ExtractMemoryMBFromQuantity(q resource.Quantity) int64
- func IsValidSandboxID(id string) bool
- func SandboxStateFromStatus(status string) string
- func ToE2BListedSandbox(sb *apidomain.Sandbox, pool *agentsv1alpha1.SandboxPool) e2bgen.ListedSandbox
- func ToE2BSandbox(sb *apidomain.Sandbox, pool *agentsv1alpha1.SandboxPool, gatewayDomain string) e2bgen.Sandbox
- func ToE2BSandboxDetail(sb *apidomain.Sandbox, pool *agentsv1alpha1.SandboxPool, gatewayDomain string) e2bgen.SandboxDetail
- func ToE2BTemplate(pool *agentsv1alpha1.SandboxPool) e2bgen.Template
Constants ¶
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 ¶
BuildE2BEndpointURL builds the E2B-style connection URL for a sandbox. Uses the private path protocol: scheme://domain/agentbox/<sandboxID>/<port>
func ExtractCPUFromQuantity ¶
ExtractCPUFromQuantity converts a resource.Quantity to an int32 CPU count.
func ExtractMemoryMBFromQuantity ¶
ExtractMemoryMBFromQuantity converts a resource.Quantity to int64 MB.
func IsValidSandboxID ¶
IsValidSandboxID returns true if the sandbox ID matches the expected format.
func SandboxStateFromStatus ¶
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.