Documentation
¶
Index ¶
- type AccessControl
- type EncryptionManager
- type Manager
- func (m *Manager) BackupVolume(name, outputPath string) error
- func (m *Manager) CloneVolume(ctx context.Context, sourceName, targetName string) error
- func (m *Manager) Close() error
- func (m *Manager) CreateVolume(ctx context.Context, options interface{}) (interface{}, error)
- func (m *Manager) CreateVolumeSimple(ctx context.Context, name string, size int64) (*VolumeStatus, error)
- func (m *Manager) CreateVolumeSimpleInterface(ctx context.Context, name string, size int64) (interface{}, error)
- func (m *Manager) CreateVolumeWithOptions(ctx context.Context, options VolumeOptions) (*VolumeStatus, error)
- func (m *Manager) DecryptData(tenantID *string, encryptedData []byte) ([]byte, error)
- func (m *Manager) DeleteNode(id string) error
- func (m *Manager) DeleteVolume(name string) error
- func (m *Manager) DeleteVolumeWithContext(ctx context.Context, name string) error
- func (m *Manager) DeleteVolumeWithOptions(ctx context.Context, name, userID, tenantID string) error
- func (m *Manager) EncryptData(tenantID *string, data []byte) ([]byte, error)
- func (m *Manager) GetNodes() ([]struct{ ... }, error)
- func (m *Manager) GetStorageAuditLogs() []StorageAuditLogEntry
- func (m *Manager) GetTenantStorageAuditLogs(tenantID string) []StorageAuditLogEntry
- func (m *Manager) GetTenantStorageStats(tenantID string) *TenantStorageStats
- func (m *Manager) GetTenantStorageUsage(ctx context.Context, tenantID string) (int64, error)
- func (m *Manager) GetTotalStorageUsage(ctx context.Context) (int64, error)
- func (m *Manager) GetVolumeAuditLogs(volumeName string) []StorageAuditLogEntry
- func (m *Manager) GetVolumeMetadata(ctx context.Context, volumeName string) (map[string]string, error)
- func (m *Manager) GetVolumeStatus(name string) (*VolumeStatus, error)
- func (m *Manager) GetVolumeUsage(ctx context.Context, volumeName string) (int64, error)
- func (m *Manager) GetVolumes() ([]VolumeStatus, error)
- func (m *Manager) IsVolumeInUse(name string) (bool, error)
- func (m *Manager) ListVolumes(ctx context.Context) ([]VolumeStatus, error)
- func (m *Manager) ListVolumesInterface(ctx context.Context) ([]interface{}, error)
- func (m *Manager) MonitorVolumeHealth(ctx context.Context, volumeName string) error
- func (m *Manager) MountVolume(ctx context.Context, volumeName, containerID, mountPath string) error
- func (m *Manager) ReadFromVolume(ctx context.Context, volumeName string, offset, length int64) ([]byte, error)
- func (m *Manager) ResizeVolume(ctx context.Context, name string, newSize int64) error
- func (m *Manager) RestoreVolume(name, inputPath string) error
- func (m *Manager) RestoreVolumeFromSnapshot(ctx context.Context, volumeName, snapshotName string) error
- func (m *Manager) SaveNode(id, address string, joinedAt int64) error
- func (m *Manager) SaveVolume(name, path string, size, createdAt int64) error
- func (m *Manager) SetTenantStorageRateLimit(tenantID string, rateLimit uint32) error
- func (m *Manager) SetVolumeMetadata(ctx context.Context, volumeName string, metadata map[string]string) error
- func (m *Manager) SnapshotVolume(ctx context.Context, volumeName, snapshotName string) error
- func (m *Manager) StartVolumeHealthMonitoring(ctx context.Context, interval time.Duration)
- func (m *Manager) UnmountVolume(ctx context.Context, volumeName, containerID string) error
- func (m *Manager) UpdateNodeResources(nodeID string, cpu int, memory int, disk int64) error
- func (m *Manager) UpdateNodeStatus(nodeID string, status string) error
- func (m *Manager) UpdateVolumeState(name string, state VolumeState) error
- func (m *Manager) WithAccessControl(accessControl AccessControl) *Manager
- func (m *Manager) WithEncryptionManager(encryptionManager EncryptionManager) *Manager
- func (m *Manager) WithQoSManager(qosManager QoSManager) *Manager
- func (m *Manager) WriteToVolume(ctx context.Context, volumeName string, data []byte, offset int64) error
- type QoSManager
- type StorageAuditLogEntry
- type TenantStorageStats
- type VolumeOptions
- type VolumeState
- type VolumeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl interface {
CheckAccess(userID, tenantID, resource, action string) bool
LogAccess(userID, tenantID, resource, action, details string)
GetAuditLogs() []StorageAuditLogEntry
GetTenantAuditLogs(tenantID string) []StorageAuditLogEntry
GetVolumeAuditLogs(volumeName string) []StorageAuditLogEntry
}
AccessControl handles access control for storage
type EncryptionManager ¶
type EncryptionManager interface {
Encrypt(tenantID *string, data []byte) ([]byte, error)
Decrypt(tenantID *string, encryptedData []byte) ([]byte, error)
}
EncryptionManager handles encryption of data
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles storage operations
func NewManager ¶
NewManager creates a new storage manager
func (*Manager) BackupVolume ¶
BackupVolume backs up a volume to a file
func (*Manager) CloneVolume ¶
CloneVolume clones a volume
func (*Manager) CreateVolume ¶
CreateVolumeInterface is an adapter method to match the app.StorageManager interface
func (*Manager) CreateVolumeSimple ¶
func (m *Manager) CreateVolumeSimple(ctx context.Context, name string, size int64) (*VolumeStatus, error)
CreateVolumeSimple creates a new volume with just a name and size
func (*Manager) CreateVolumeSimpleInterface ¶
func (m *Manager) CreateVolumeSimpleInterface(ctx context.Context, name string, size int64) (interface{}, error)
CreateVolumeSimpleInterface is an adapter method to match the app.StorageManager interface
func (*Manager) CreateVolumeWithOptions ¶
func (m *Manager) CreateVolumeWithOptions(ctx context.Context, options VolumeOptions) (*VolumeStatus, error)
CreateVolumeWithOptions creates a new volume
func (*Manager) DecryptData ¶
DecryptData decrypts data for a tenant
func (*Manager) DeleteNode ¶
DeleteNode deletes a node from the database
func (*Manager) DeleteVolume ¶
DeleteVolume deletes a volume from the database
func (*Manager) DeleteVolumeWithContext ¶
DeleteVolumeWithContext deletes a volume with context
func (*Manager) DeleteVolumeWithOptions ¶
DeleteVolumeWithOptions deletes a volume with options
func (*Manager) EncryptData ¶
EncryptData encrypts data for a tenant
func (*Manager) GetStorageAuditLogs ¶
func (m *Manager) GetStorageAuditLogs() []StorageAuditLogEntry
GetStorageAuditLogs returns storage audit logs
func (*Manager) GetTenantStorageAuditLogs ¶
func (m *Manager) GetTenantStorageAuditLogs(tenantID string) []StorageAuditLogEntry
GetTenantStorageAuditLogs returns storage audit logs for a tenant
func (*Manager) GetTenantStorageStats ¶
func (m *Manager) GetTenantStorageStats(tenantID string) *TenantStorageStats
GetTenantStorageStats returns storage stats for a tenant
func (*Manager) GetTenantStorageUsage ¶
GetTenantStorageUsage returns the storage usage for a tenant
func (*Manager) GetTotalStorageUsage ¶
GetTotalStorageUsage returns the total storage usage
func (*Manager) GetVolumeAuditLogs ¶
func (m *Manager) GetVolumeAuditLogs(volumeName string) []StorageAuditLogEntry
GetVolumeAuditLogs returns storage audit logs for a volume
func (*Manager) GetVolumeMetadata ¶
func (m *Manager) GetVolumeMetadata(ctx context.Context, volumeName string) (map[string]string, error)
GetVolumeMetadata gets metadata for a volume
func (*Manager) GetVolumeStatus ¶
func (m *Manager) GetVolumeStatus(name string) (*VolumeStatus, error)
GetVolumeStatus returns the status of a volume
func (*Manager) GetVolumeUsage ¶
GetVolumeUsage returns the usage of a volume
func (*Manager) GetVolumes ¶
func (m *Manager) GetVolumes() ([]VolumeStatus, error)
GetVolumes returns all volumes
func (*Manager) IsVolumeInUse ¶
IsVolumeInUse checks if a volume is in use
func (*Manager) ListVolumes ¶
func (m *Manager) ListVolumes(ctx context.Context) ([]VolumeStatus, error)
ListVolumes returns all volumes with context
func (*Manager) ListVolumesInterface ¶
ListVolumesInterface is an adapter method to match the app.StorageManager interface
func (*Manager) MonitorVolumeHealth ¶
MonitorVolumeHealth monitors the health of a volume
func (*Manager) MountVolume ¶
MountVolume mounts a volume to a container
func (*Manager) ReadFromVolume ¶
func (m *Manager) ReadFromVolume(ctx context.Context, volumeName string, offset, length int64) ([]byte, error)
ReadFromVolume reads data from a volume
func (*Manager) ResizeVolume ¶
ResizeVolume resizes a volume
func (*Manager) RestoreVolume ¶
RestoreVolume restores a volume from a backup file
func (*Manager) RestoreVolumeFromSnapshot ¶
func (m *Manager) RestoreVolumeFromSnapshot(ctx context.Context, volumeName, snapshotName string) error
RestoreVolumeFromSnapshot restores a volume from a snapshot
func (*Manager) SaveVolume ¶
SaveVolume saves volume information to the database
func (*Manager) SetTenantStorageRateLimit ¶
SetTenantStorageRateLimit sets the rate limit for a tenant
func (*Manager) SetVolumeMetadata ¶
func (m *Manager) SetVolumeMetadata(ctx context.Context, volumeName string, metadata map[string]string) error
SetVolumeMetadata sets metadata for a volume
func (*Manager) SnapshotVolume ¶
SnapshotVolume creates a snapshot of a volume
func (*Manager) StartVolumeHealthMonitoring ¶
StartVolumeHealthMonitoring starts monitoring the health of all volumes
func (*Manager) UnmountVolume ¶
UnmountVolume unmounts a volume from a container
func (*Manager) UpdateNodeResources ¶
UpdateNodeResources updates the resources of a node in the database
func (*Manager) UpdateNodeStatus ¶
UpdateNodeStatus updates the status of a node in the database
func (*Manager) UpdateVolumeState ¶
func (m *Manager) UpdateVolumeState(name string, state VolumeState) error
UpdateVolumeState updates the state of a volume
func (*Manager) WithAccessControl ¶
func (m *Manager) WithAccessControl(accessControl AccessControl) *Manager
WithAccessControl sets the access control
func (*Manager) WithEncryptionManager ¶
func (m *Manager) WithEncryptionManager(encryptionManager EncryptionManager) *Manager
WithEncryptionManager sets the encryption manager
func (*Manager) WithQoSManager ¶
func (m *Manager) WithQoSManager(qosManager QoSManager) *Manager
WithQoSManager sets the QoS manager
type QoSManager ¶
type QoSManager interface {
SetTenantRateLimit(tenantID string, rateLimit uint32) error
GetTenantStats(tenantID string) *TenantStorageStats
}
QoSManager handles quality of service for storage
type StorageAuditLogEntry ¶
type StorageAuditLogEntry struct {
Timestamp int64
Action string
UserID string
TenantID string
Resource string
Details string
}
StorageAuditLogEntry represents an entry in the storage audit log
type TenantStorageStats ¶
type TenantStorageStats struct {
TotalSize int64
UsedSize int64
VolumeCount int
ReadOps int64
WriteOps int64
ReadBytes int64
WriteBytes int64
LastUpdateTime int64
}
TenantStorageStats represents storage statistics for a tenant
type VolumeOptions ¶
type VolumeOptions struct {
Name string
Size int64
TenantID string
UserID string
Metadata map[string]string
}
VolumeOptions represents options for creating a volume
type VolumeState ¶
type VolumeState string
VolumeState represents the state of a volume
const ( // VolumeStateAvailable indicates the volume is available VolumeStateAvailable VolumeState = "available" // VolumeStateInUse indicates the volume is in use VolumeStateInUse VolumeState = "in_use" // VolumeStateFailed indicates the volume has failed VolumeStateFailed VolumeState = "failed" )
type VolumeStatus ¶
type VolumeStatus struct {
Name string
Path string
Size int64
CreatedAt int64
State VolumeState
}
VolumeStatus represents the status of a volume