Documentation
¶
Index ¶
- Variables
- type Catalog
- type CatalogSandbox
- type CatalogTemplate
- type E2BService
- func (s *E2BService) ListRunnerSandboxes(ctx context.Context) ([]CatalogSandbox, error)
- func (s *E2BService) ListTemplates(ctx context.Context) ([]CatalogTemplate, error)
- func (s *E2BService) StartRunner(ctx context.Context, input StartInput) (StartResult, error)
- func (s *E2BService) StartTerminal(ctx context.Context, sandboxID string, size PtySize, onData func([]byte)) (TerminalSession, error)
- func (s *E2BService) StopRunner(ctx context.Context, sandboxID string, pid uint32) error
- func (s *E2BService) ValidateTemplate(ctx context.Context, templateID string) error
- type ExitResult
- type PtySize
- type Service
- type StartInput
- type StartResult
- type TerminalSession
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog interface {
ListTemplates(ctx context.Context) ([]CatalogTemplate, error)
ListRunnerSandboxes(ctx context.Context) ([]CatalogSandbox, error)
}
type CatalogSandbox ¶
type CatalogSandbox struct {
SandboxID string `json:"sandbox_id"`
TemplateID string `json:"template_id"`
Alias string `json:"alias,omitempty"`
State string `json:"state"`
CPUCount int32 `json:"cpu_count"`
MemoryMB int32 `json:"memory_mb"`
DiskSizeMB int32 `json:"disk_size_mb"`
StartedAt time.Time `json:"started_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type CatalogTemplate ¶
type CatalogTemplate struct {
TemplateID string `json:"template_id"`
Aliases []string `json:"aliases"`
BuildStatus string `json:"build_status"`
CPUCount int32 `json:"cpu_count"`
MemoryMB int32 `json:"memory_mb"`
DiskSizeMB int32 `json:"disk_size_mb"`
Public bool `json:"public"`
SpawnCount int64 `json:"spawn_count"`
UpdatedAt time.Time `json:"updated_at"`
}
type E2BService ¶
type E2BService struct {
// contains filtered or unexported fields
}
func NewE2BService ¶
func NewE2BService(apiKey, endpoint string, httpClient *http.Client) (*E2BService, error)
func (*E2BService) ListRunnerSandboxes ¶
func (s *E2BService) ListRunnerSandboxes(ctx context.Context) ([]CatalogSandbox, error)
func (*E2BService) ListTemplates ¶
func (s *E2BService) ListTemplates(ctx context.Context) ([]CatalogTemplate, error)
func (*E2BService) StartRunner ¶
func (s *E2BService) StartRunner(ctx context.Context, input StartInput) (StartResult, error)
func (*E2BService) StartTerminal ¶
func (s *E2BService) StartTerminal(ctx context.Context, sandboxID string, size PtySize, onData func([]byte)) (TerminalSession, error)
func (*E2BService) StopRunner ¶
func (*E2BService) ValidateTemplate ¶
func (s *E2BService) ValidateTemplate(ctx context.Context, templateID string) error
type Service ¶
type Service interface {
ValidateTemplate(ctx context.Context, templateID string) error
StartRunner(ctx context.Context, input StartInput) (StartResult, error)
StopRunner(ctx context.Context, sandboxID string, pid uint32) error
StartTerminal(ctx context.Context, sandboxID string, size PtySize, onData func([]byte)) (TerminalSession, error)
}
type StartInput ¶
type StartResult ¶
Click to show internal directories.
Click to hide internal directories.