Documentation ¶
Index ¶
- Constants
- func WithLimiter(limiter limit.Limiter) func(*VolumeManager)
- func WithMounter(mounter mount.Interface) func(*VolumeManager)
- type AccessType
- type StateManager
- func (s *StateManager) DeleteVolumeState(id string) error
- func (s *StateManager) GetTotalVolumesSize() int64
- func (s *StateManager) GetVolumeStateByID(id string) *VolumeState
- func (s *StateManager) GetVolumeStateByName(name string) *VolumeState
- func (s *StateManager) GetVolumes() []VolumeState
- func (s *StateManager) SaveVolumeState(volume *VolumeState) (err error)
- type VolumeManager
- func (v *VolumeManager) CreateVolume(volID, name string, capacity int64, volAccessType AccessType) error
- func (v *VolumeManager) DeleteVolume(volID string) error
- func (v *VolumeManager) GetAvailableCapacity() (int64, error)
- func (v *VolumeManager) GetVolumeStateByID(id string) *VolumeState
- func (v *VolumeManager) GetVolumeStateByName(name string) *VolumeState
- func (v *VolumeManager) GetVolumeStatistics(volumePath string) (*VolumeStatistics, error)
- func (v *VolumeManager) Mount(volumeID, targetPath, fsType string, mountOptions []string) error
- func (v *VolumeManager) SupportedAccessTypes() []AccessType
- func (v *VolumeManager) SupportedFilesystems() []string
- func (v *VolumeManager) Unmount(targetPath string) error
- type VolumeManagerOption
- type VolumeState
- type VolumeStatistics
Constants ¶
View Source
const (
MetadataFileMaxSize = 4 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func WithLimiter ¶
func WithLimiter(limiter limit.Limiter) func(*VolumeManager)
func WithMounter ¶
func WithMounter(mounter mount.Interface) func(*VolumeManager)
Types ¶
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
func NewStateManager ¶
func NewStateManager(workspacePath string) (*StateManager, error)
func (*StateManager) DeleteVolumeState ¶
func (s *StateManager) DeleteVolumeState(id string) error
func (*StateManager) GetTotalVolumesSize ¶
func (s *StateManager) GetTotalVolumesSize() int64
func (*StateManager) GetVolumeStateByID ¶
func (s *StateManager) GetVolumeStateByID(id string) *VolumeState
func (*StateManager) GetVolumeStateByName ¶
func (s *StateManager) GetVolumeStateByName(name string) *VolumeState
func (*StateManager) GetVolumes ¶
func (s *StateManager) GetVolumes() []VolumeState
func (*StateManager) SaveVolumeState ¶
func (s *StateManager) SaveVolumeState(volume *VolumeState) (err error)
type VolumeManager ¶
type VolumeManager struct {
// contains filtered or unexported fields
}
func NewVolumeManager ¶
func NewVolumeManager(volumesDir string, sm *StateManager, options ...VolumeManagerOption) (*VolumeManager, error)
func (*VolumeManager) CreateVolume ¶
func (v *VolumeManager) CreateVolume(volID, name string, capacity int64, volAccessType AccessType) error
func (*VolumeManager) DeleteVolume ¶
func (v *VolumeManager) DeleteVolume(volID string) error
func (*VolumeManager) GetAvailableCapacity ¶
func (v *VolumeManager) GetAvailableCapacity() (int64, error)
func (*VolumeManager) GetVolumeStateByID ¶
func (v *VolumeManager) GetVolumeStateByID(id string) *VolumeState
func (*VolumeManager) GetVolumeStateByName ¶
func (v *VolumeManager) GetVolumeStateByName(name string) *VolumeState
func (*VolumeManager) GetVolumeStatistics ¶
func (v *VolumeManager) GetVolumeStatistics(volumePath string) (*VolumeStatistics, error)
func (*VolumeManager) Mount ¶
func (v *VolumeManager) Mount(volumeID, targetPath, fsType string, mountOptions []string) error
func (*VolumeManager) SupportedAccessTypes ¶
func (v *VolumeManager) SupportedAccessTypes() []AccessType
func (*VolumeManager) SupportedFilesystems ¶
func (v *VolumeManager) SupportedFilesystems() []string
func (*VolumeManager) Unmount ¶
func (v *VolumeManager) Unmount(targetPath string) error
type VolumeManagerOption ¶
type VolumeManagerOption func(v *VolumeManager)
type VolumeState ¶
type VolumeState struct { Name string `json:"name"` ID string `json:"id"` LimitID uint32 `json:"limitID"` Size int64 `json:"size"` }
func (*VolumeState) IsEmpty ¶
func (vs *VolumeState) IsEmpty() bool
func (*VolumeState) VolumePath ¶
func (vs *VolumeState) VolumePath(volumesDir string) string
Click to show internal directories.
Click to hide internal directories.