forked from wrenn/wrenn
Introduces internal/layout package for centralized path construction,
migrates templates from name-based TEXT primary keys to UUID PKs with
team-scoped directories (WRENN_DIR/images/teams/{team_id}/{template_id}).
The built-in minimal template uses sentinel zero UUIDs. Proto messages
carry team_id + template_id alongside deprecated template name field.
Team deletion now cleans up template files across all hosts.
34 lines
711 B
Go
34 lines
711 B
Go
package models
|
|
|
|
import (
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
// SandboxStatus represents the current state of a sandbox.
|
|
type SandboxStatus string
|
|
|
|
const (
|
|
StatusPending SandboxStatus = "pending"
|
|
StatusRunning SandboxStatus = "running"
|
|
StatusPaused SandboxStatus = "paused"
|
|
StatusStopped SandboxStatus = "stopped"
|
|
StatusError SandboxStatus = "error"
|
|
)
|
|
|
|
// Sandbox holds all state for a running sandbox on this host.
|
|
type Sandbox struct {
|
|
ID string
|
|
Status SandboxStatus
|
|
TemplateTeamID [16]byte
|
|
TemplateID [16]byte
|
|
VCPUs int
|
|
MemoryMB int
|
|
TimeoutSec int
|
|
SlotIndex int
|
|
HostIP net.IP
|
|
RootfsPath string
|
|
CreatedAt time.Time
|
|
LastActiveAt time.Time
|
|
}
|