storage

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDriveWithTimeout

func EnsureDriveWithTimeout(dm DriveManager, workspaceID, namespace string) ([]process.VolumeMount, error)

EnsureDriveWithTimeout wraps EnsureDrive with a default timeout.

Types

type DockerDriveAdapter

type DockerDriveAdapter struct {
	// contains filtered or unexported fields
}

DockerDriveAdapter adapts DockerWorkspaceDriveManager to the DriveManager interface.

func (*DockerDriveAdapter) EnsureDrive

func (a *DockerDriveAdapter) EnsureDrive(ctx context.Context, workspaceID, namespace string) ([]process.VolumeMount, error)

type DockerWorkspaceDriveManager

type DockerWorkspaceDriveManager struct {
	// contains filtered or unexported fields
}

DockerWorkspaceDriveManager handles workspace Docker volume creation.

func NewDockerWorkspaceDriveManager

func NewDockerWorkspaceDriveManager(database *db.DB) *DockerWorkspaceDriveManager

NewDockerWorkspaceDriveManager creates a Docker-backed workspace drive manager.

func (*DockerWorkspaceDriveManager) EnsureVolume

func (m *DockerWorkspaceDriveManager) EnsureVolume(workspaceID string) ([]process.VolumeMount, error)

EnsureVolume ensures a Docker named volume exists for the workspace.

type DriveManager

type DriveManager interface {
	EnsureDrive(ctx context.Context, workspaceID, namespace string) ([]process.VolumeMount, error)
}

DriveManager is a backend-agnostic interface for workspace drive management.

func NewDockerDriveAdapter

func NewDockerDriveAdapter(mgr *DockerWorkspaceDriveManager) DriveManager

func NewK8sDriveAdapter

func NewK8sDriveAdapter(mgr *WorkspaceDriveManager) DriveManager

type K8sDriveAdapter

type K8sDriveAdapter struct {
	// contains filtered or unexported fields
}

K8sDriveAdapter adapts WorkspaceDriveManager to the DriveManager interface.

func (*K8sDriveAdapter) EnsureDrive

func (a *K8sDriveAdapter) EnsureDrive(ctx context.Context, workspaceID, namespace string) ([]process.VolumeMount, error)

type NilDriveManager

type NilDriveManager struct{}

NilDriveManager is a no-op drive manager for when storage is not configured.

func (NilDriveManager) EnsureDrive

func (NilDriveManager) EnsureDrive(ctx context.Context, workspaceID, namespace string) ([]process.VolumeMount, error)

type WorkspaceDriveManager

type WorkspaceDriveManager struct {
	// contains filtered or unexported fields
}

WorkspaceDriveManager handles workspace persistent volume creation.

func NewWorkspaceDriveManager

func NewWorkspaceDriveManager(database *db.DB, clientset kubernetes.Interface, storageSize int64, storageClassName string) *WorkspaceDriveManager

NewWorkspaceDriveManager creates a K8s-backed workspace drive manager.

func (*WorkspaceDriveManager) EnsurePVC

func (m *WorkspaceDriveManager) EnsurePVC(ctx context.Context, workspaceID, namespace string) ([]process.VolumeMount, error)

EnsurePVC creates a PVC for the workspace in the given namespace if it doesn't exist and records it in the DB.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL