Versions in this module Expand all Collapse all v0 v0.0.3 Feb 13, 2026 v0.0.2 Feb 10, 2026 Changes in this version + func DecodeJSON(r *http.Request, v any) error + func ErrorResponse(w http.ResponseWriter, status int, message string) + func GetCacheDir() string + func GetEnv(key, defaultValue string) string + func GetEnvBool(key string, defaultValue bool) bool + func GetEnvDuration(key string, defaultValue time.Duration) time.Duration + func GetEnvInt(key string, defaultValue int) int + func GetEnvInt64(key string, defaultValue int64) int64 + func JSONResponse(w http.ResponseWriter, status int, data any) + func ReadFile(ctx context.Context, instance cc.Instance, path string) ([]byte, error) + func WriteFiles(ctx context.Context, instance cc.Instance, files map[string][]byte) error + type BaseConfig struct + DefaultMemoryMB uint64 + DefaultTimeout time.Duration + LogLevel string + MaxConcurrent int + Port string + func LoadBaseConfig() BaseConfig + type Histogram struct + func NewHistogram() *Histogram + func (h *Histogram) Observe(value float64) + func (h *Histogram) Stats() (float64, int64) + type Metrics struct + func NewMetrics() *Metrics + func (m *Metrics) Counter(name string, delta int64) + func (m *Metrics) Gauge(name string, value int64) + func (m *Metrics) Handler() http.HandlerFunc + func (m *Metrics) Histogram(name string, value float64) + func (m *Metrics) Timer(name string) func() + type RunResult struct + Duration time.Duration + Error string + ExitCode int + Stderr string + Stdout string + TimedOut bool + func RunCommand(ctx context.Context, instance cc.Instance, name string, args ...string) RunResult + func RunCommandWithEnv(ctx context.Context, instance cc.Instance, env []string, name string, ...) RunResult + func RunCommandWithStdin(ctx context.Context, instance cc.Instance, stdin io.Reader, name string, ...) RunResult + type SandboxPool struct + func NewSandboxPool(source cc.InstanceSource, size int, opts ...cc.Option) *SandboxPool + func (p *SandboxPool) Acquire(ctx context.Context) (cc.Instance, error) + func (p *SandboxPool) Close() error + func (p *SandboxPool) Release(instance cc.Instance) + func (p *SandboxPool) Warm(ctx context.Context) error + type Server struct + func NewServer(addr string, handler http.Handler, logger *slog.Logger) *Server + func (s *Server) HealthHandler() http.HandlerFunc + func (s *Server) IsHealthy() bool + func (s *Server) IsReady() bool + func (s *Server) ListenAndServeWithGracefulShutdown() error + func (s *Server) ReadyHandler() http.HandlerFunc + func (s *Server) SetReady(ready bool)