@@ -5,14 +5,39 @@ import (
55 "sort"
66)
77
8+ // SandboxConfig holds provider-agnostic sandbox configuration.
9+ type SandboxConfig struct {
10+ Version string
11+ Dir string // sandbox directory path
12+ Port int // primary port
13+ AdminPort int // admin/management port (0 if not applicable)
14+ Host string // bind address
15+ DbUser string // admin username
16+ DbPassword string // admin password
17+ Options map [string ]string // provider-specific key-value options
18+ }
19+
20+ // SandboxInfo describes a deployed sandbox instance.
21+ type SandboxInfo struct {
22+ Dir string
23+ Port int
24+ Socket string
25+ Status string // "running", "stopped"
26+ }
27+
828// Provider is the core abstraction for deploying database infrastructure.
9- // Phase 2a defines a minimal interface (Name, ValidateVersion, DefaultPorts).
10- // Phase 2b will add CreateSandbox, Start, Stop, Destroy, HealthCheck when
11- // ProxySQL and other providers need them.
1229type Provider interface {
1330 Name () string
1431 ValidateVersion (version string ) error
1532 DefaultPorts () PortRange
33+ // FindBinary returns the path to the provider's main binary, or error if not found.
34+ FindBinary (version string ) (string , error )
35+ // CreateSandbox deploys a new sandbox instance.
36+ CreateSandbox (config SandboxConfig ) (* SandboxInfo , error )
37+ // StartSandbox starts a stopped sandbox.
38+ StartSandbox (dir string ) error
39+ // StopSandbox stops a running sandbox.
40+ StopSandbox (dir string ) error
1641}
1742
1843type PortRange struct {
0 commit comments