Documentation
¶
Index ¶
- Constants
- func GetVolumesDir(dataDir string) string
- type Descriptor
- type Manager
- func (m *Manager) Create(labels map[string]string) (*Volume, error)
- func (m *Manager) Get(id string) (*Volume, bool)
- func (m *Manager) GetOrCreate(labels map[string]string) (*Volume, error)
- func (m *Manager) Remove(labels map[string]string) error
- func (m *Manager) Start()
- func (m *Manager) Stop()
- func (m *Manager) Volumes(labels map[string]string) []*Volume
- type Volume
Constants ¶
View Source
const ( // LabelAutoGenerated is the name of the label used to tag autogenerated volumes with. LabelAutoGenerated = "net.oasis.volume.auto_generated" // LabelRuntimeID is the name of the label used to store the runtime ID. LabelRuntimeID = "net.oasis.volume.runtime_id" // LabelComponentID is the name of the label used to store the component ID. LabelComponentID = "net.oasis.volume.component_id" // LabelName is the name of the label used to store the volume name. LabelName = "net.oasis.volume.name" )
View Source
const VolumesDir = "volumes"
VolumesDir is the name of the directory located inside the node's runtimes directory which contains the persistent volumes.
Variables ¶
This section is empty.
Functions ¶
func GetVolumesDir ¶
GetVolumesDir derives the path to the volumes directory.
Types ¶
type Descriptor ¶
type Descriptor struct {
// ID is the unique volume identifier.
ID string `json:"id"`
// Labels are the labels assigned to the volume.
Labels map[string]string `json:"labels"`
}
Descriptor is a serializable volume descriptor.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a volume manager.
func NewManager ¶
NewManager creates a new volume manager.
func (*Manager) Get ¶
Get retrieves the volume with the specified identifier.
If the volume cannot be found, it returns nil
func (*Manager) GetOrCreate ¶
GetOrCreate retrieves the first volume matching given labels or creates a new one.
Click to show internal directories.
Click to hide internal directories.