Documentation
¶
Index ¶
- func CheckSDKConnection(ctx context.Context) error
- func NewSDKClient() (*client.Client, error)
- func Run(ctx context.Context, workspace string, argv []string, stdout, stderr io.Writer) (int, error)
- func RunWithSDK(ctx context.Context, workspace string, argv []string, user string, ...) (int, error)
- func RunWithSDKRuntime(ctx context.Context, workspace string, argv []string, user string, ...) (int, error)
- func RunWithSDKRuntimeModules(ctx context.Context, workspace string, argv []string, user string, ...) (int, error)
- func RunWithSDKRuntimeOfflineExec(ctx context.Context, workspace string, argv []string, user string, ...) (exitCode int, runErr error)
- func RunWithSDKRuntimeSnapshotExec(ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, ...) (exitCode int, runErr error)
- func RunWithSDKRuntimeSnapshotExecSelectiveReadersV3(ctx context.Context, workspaceTAR io.Reader, moduleTAR io.Reader, ...) (int, error)
- func RunWithSDKRuntimeSnapshotExecSelectiveV3(ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, ...) (int, error)
- func RunWithSDKRuntimeSnapshotExecVerified(ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, ...) (int, error)
- func RunWithSDKRuntimeSnapshotExecVerifiedWithMemory(ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, ...) (int, error)
- func RunWithSDKRuntimeTarget(ctx context.Context, workspace string, argv []string, user string, ...) (int, error)
- func RunWithUser(ctx context.Context, workspace string, argv []string, user string, ...) (int, error)
- type ExpectedGoModule
- type RuntimeSpec
- type SnapshotVolumes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSDKConnection ¶
CheckSDKConnection verifies that Docker Engine is reachable.
func NewSDKClient ¶
NewSDKClient creates a Docker Engine API client using the user's Docker environment configuration.
func RunWithSDK ¶
func RunWithSDK( ctx context.Context, workspace string, argv []string, user string, stdout, stderr io.Writer, ) (int, error)
RunWithSDK executes a command using the legacy Alpine runtime.
func RunWithSDKRuntime ¶
func RunWithSDKRuntime( ctx context.Context, workspace string, argv []string, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (int, error)
RunWithSDKRuntime executes a command using an allowlisted runtime.
func RunWithSDKRuntimeModules ¶
func RunWithSDKRuntimeModules( ctx context.Context, workspace string, argv []string, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, artifactsDir string, ) (int, error)
RunWithSDKRuntimeModules executes a Go command with staged module artifacts. The caller must provide a trusted, immutable staging directory.
func RunWithSDKRuntimeSnapshotExec ¶
func RunWithSDKRuntimeSnapshotExec( ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (exitCode int, runErr error)
RunWithSDKRuntimeSnapshotExec executes offline Go commands using Docker-managed volumes rather than host bind mounts.
The caller supplies TAR archives constructed from verified capsule data. The executor owns all Docker resources.
func RunWithSDKRuntimeSnapshotExecSelectiveReadersV3 ¶
func RunWithSDKRuntimeSnapshotExecSelectiveReadersV3( ctx context.Context, workspaceTAR io.Reader, moduleTAR io.Reader, argv []string, expected []ExpectedGoModule, materialized []ExpectedGoModule, memoryBytes int64, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (int, error)
RunWithSDKRuntimeSnapshotExecSelectiveReadersV3 runs selective offline Go replay using two prevalidated TAR readers. Readers are consumed once and are not closed by this function.
func RunWithSDKRuntimeSnapshotExecSelectiveV3 ¶
func RunWithSDKRuntimeSnapshotExecSelectiveV3( ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, expected []ExpectedGoModule, materialized []ExpectedGoModule, memoryBytes int64, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (int, error)
RunWithSDKRuntimeSnapshotExecSelectiveV3 materializes only modules with complete ZIP artifacts, while verifying the full selected Go module graph before executing the captured command.
func RunWithSDKRuntimeSnapshotExecVerified ¶
func RunWithSDKRuntimeSnapshotExecVerified( ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, expected []ExpectedGoModule, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (int, error)
RunWithSDKRuntimeSnapshotExecVerified requires an exact offline Go module graph match before executing the captured command.
func RunWithSDKRuntimeSnapshotExecVerifiedWithMemory ¶
func RunWithSDKRuntimeSnapshotExecVerifiedWithMemory( ctx context.Context, workspaceTAR []byte, moduleTAR []byte, argv []string, expected []ExpectedGoModule, memoryBytes int64, user string, stdout, stderr io.Writer, runtime *RuntimeSpec, ) (int, error)
RunWithSDKRuntimeSnapshotExecVerifiedWithMemory runs schema-v3 replay with an explicitly bounded execution-container memory limit.
Types ¶
type ExpectedGoModule ¶
ExpectedGoModule identifies a selected external Go module.
type RuntimeSpec ¶
type SnapshotVolumes ¶
type SnapshotVolumes struct {
Workspace string
ModuleCache string
// contains filtered or unexported fields
}
SnapshotVolumes owns Docker resources created for one replay. Close must be called before closing the Docker client.
Not safe for concurrent use.
func CreateSnapshotVolumes ¶
func CreateSnapshotVolumes( ctx context.Context, dockerClient *client.Client, image string, workspaceTAR, moduleTAR []byte, ) (*SnapshotVolumes, error)
CreateSnapshotVolumes uploads two in-memory TAR archives into separate Docker-managed volumes.
image must already be available to the Docker daemon. The caller owns the returned volumes and must call Close.
func CreateSnapshotVolumesFromReaders ¶
func CreateSnapshotVolumesFromReaders( ctx context.Context, dockerClient *client.Client, image string, workspaceTAR, moduleTAR io.Reader, ) (*SnapshotVolumes, error)
CreateSnapshotVolumesFromReaders uploads two TAR streams into Docker-managed volumes without materializing them as byte slices.
Readers must remain valid until this call returns. They are consumed once and are not closed by this function.
func (*SnapshotVolumes) Close ¶
func (v *SnapshotVolumes) Close() error
Close removes the volumes and any remaining preparation containers. It uses a fresh context even if replay was canceled.
Source Files
¶
- docker.go
- legacy_image.go
- run_id.go
- sdk.go
- sdk_config.go
- sdk_exec_helper.go
- sdk_go_modules.go
- sdk_go_platform.go
- sdk_image.go
- sdk_memory_v3.go
- sdk_module_graph_verify.go
- sdk_offline_commands.go
- sdk_offline_exec.go
- sdk_run.go
- sdk_runtime.go
- sdk_selective_module_download_v3.go
- sdk_snapshot_exec.go
- sdk_snapshot_volumes.go