storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatePending         = "pending"
	StateCreating        = "creating"
	StateCreatingFailed  = "creating_failed"
	StateAvailable       = "available"
	StateAttaching       = "attaching"
	StateAttachingFailed = "attaching_failed"
	StateAttached        = "attached"
	StateDetaching       = "detaching"
	StateDetachingFailed = "detaching_failed"
	StateDeleting        = "deleting"
	StateDeletingFailed  = "deleting_failed"
	StateDeleted         = "deleted"
	StateError           = "error"
)

Volume states — used by backends and the volume FSM.

Variables

This section is empty.

Functions

This section is empty.

Types

type Volume

type Volume struct {
	ID        string
	Name      string
	SizeMB    int
	State     string
	Backend   string
	NodeID    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Volume holds the metadata for a single block storage volume.

type VolumeBackend

type VolumeBackend interface {
	CreateVolume(ctx context.Context, name string, sizeMB int) (*Volume, error)
	DeleteVolume(ctx context.Context, name string) error
	ListVolumes(ctx context.Context) ([]*Volume, error)
	GetVolume(ctx context.Context, name string) (*Volume, error)
	AttachVolume(ctx context.Context, name string, nodeID string) error
	DetachVolume(ctx context.Context, name string) error
	HealthCheck(ctx context.Context) error
	BackendName() string
	Close(context.Context) error
}

VolumeBackend is the central interface every storage backend must implement. Defined on the consumer side — backends implement it.

Directories

Path Synopsis
Package ceph is gated behind -tags ceph (requires librados-dev + librbd-dev).
Package ceph is gated behind -tags ceph (requires librados-dev + librbd-dev).
Package mock implements VolumeBackend entirely in memory.
Package mock implements VolumeBackend entirely in memory.

Jump to

Keyboard shortcuts

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