Documentation ¶
Index ¶
- Variables
- type VolumeStore
- func (s *VolumeStore) AddAll(vols []volume.Volume)
- func (s *VolumeStore) Count(v volume.Volume) uint
- func (s *VolumeStore) Create(name, driverName string, opts map[string]string) (volume.Volume, error)
- func (s *VolumeStore) Decrement(v volume.Volume)
- func (s *VolumeStore) FilterByDriver(name string) []volume.Volume
- func (s *VolumeStore) Get(name string) (volume.Volume, error)
- func (s *VolumeStore) Increment(v volume.Volume)
- func (s *VolumeStore) List() []volume.Volume
- func (s *VolumeStore) Remove(v volume.Volume) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVolumeInUse is a typed error returned when trying to remove a volume that is currently in use by a container ErrVolumeInUse = errors.New("volume is in use") // ErrNoSuchVolume is a typed error returned if the requested volume doesn't exist in the volume store ErrNoSuchVolume = errors.New("no such volume") )
Functions ¶
This section is empty.
Types ¶
type VolumeStore ¶
type VolumeStore struct {
// contains filtered or unexported fields
}
VolumeStore is a struct that stores the list of volumes available and keeps track of their usage counts
func New ¶
func New() *VolumeStore
New initializes a VolumeStore to keep reference counting of volumes in the system.
func (*VolumeStore) AddAll ¶
func (s *VolumeStore) AddAll(vols []volume.Volume)
AddAll adds a list of volumes to the store
func (*VolumeStore) Count ¶
func (s *VolumeStore) Count(v volume.Volume) uint
Count returns the usage count of the passed in volume
func (*VolumeStore) Create ¶
func (s *VolumeStore) Create(name, driverName string, opts map[string]string) (volume.Volume, error)
Create tries to find an existing volume with the given name or create a new one from the passed in driver
func (*VolumeStore) Decrement ¶
func (s *VolumeStore) Decrement(v volume.Volume)
Decrement decrements the usage count of the passed in volume by 1
func (*VolumeStore) FilterByDriver ¶
func (s *VolumeStore) FilterByDriver(name string) []volume.Volume
FilterByDriver returns the available volumes filtered by driver name
func (*VolumeStore) Get ¶
func (s *VolumeStore) Get(name string) (volume.Volume, error)
Get looks if a volume with the given name exists and returns it if so
func (*VolumeStore) Increment ¶
func (s *VolumeStore) Increment(v volume.Volume)
Increment increments the usage count of the passed in volume by 1
func (*VolumeStore) List ¶
func (s *VolumeStore) List() []volume.Volume
List returns all the available volumes