package glusterfs
import "k8s.io/kubernetes/pkg/volume/glusterfs"
Package glusterfs contains the internal representation of glusterfs volumes.
Index ¶
- Variables
- func ProbeVolumePlugins() []volume.VolumePlugin
- type MinMaxAllocator
- func NewMinMaxAllocator(min, max int) (*MinMaxAllocator, error)
- func (a *MinMaxAllocator) Allocate(i int) (bool, error)
- func (a *MinMaxAllocator) AllocateNext() (int, bool, error)
- func (a *MinMaxAllocator) Free() int
- func (a *MinMaxAllocator) Has(i int) bool
- func (a *MinMaxAllocator) Release(i int) error
- func (a *MinMaxAllocator) SetRange(min, max int) error
- type Rangeable
Variables ¶
var ( //ErrConflict returned when value is already in use. ErrConflict = errors.New("number already allocated") //ErrInvalidRange returned invalid range, for eg# min > max ErrInvalidRange = errors.New("invalid range") //ErrOutOfRange returned when value is not in pool range. ErrOutOfRange = errors.New("out of range") //ErrRangeFull returned when no more free values in the pool. ErrRangeFull = errors.New("range full") //ErrInternal returned when no free item found, but a.free != 0. ErrInternal = errors.New("internal error") )
Functions ¶
func ProbeVolumePlugins ¶
func ProbeVolumePlugins() []volume.VolumePlugin
ProbeVolumePlugins is the primary entrypoint for volume plugins.
Types ¶
type MinMaxAllocator ¶
type MinMaxAllocator struct {
// contains filtered or unexported fields
}
MinMaxAllocator defines allocator struct.
func NewMinMaxAllocator ¶
func NewMinMaxAllocator(min, max int) (*MinMaxAllocator, error)
NewMinMaxAllocator return a new allocator or error based on provided min/max value.
func (*MinMaxAllocator) Allocate ¶
func (a *MinMaxAllocator) Allocate(i int) (bool, error)
Allocate allocates provided value in the allocator and mark it as used.
func (*MinMaxAllocator) AllocateNext ¶
func (a *MinMaxAllocator) AllocateNext() (int, bool, error)
AllocateNext allocates next value from the allocator.
func (*MinMaxAllocator) Free ¶
func (a *MinMaxAllocator) Free() int
Free returns the number of free values in the allocator.
func (*MinMaxAllocator) Has ¶
func (a *MinMaxAllocator) Has(i int) bool
Has check whether the provided value is used in the allocator
func (*MinMaxAllocator) Release ¶
func (a *MinMaxAllocator) Release(i int) error
Release free/delete provided value from the allocator.
func (*MinMaxAllocator) SetRange ¶
func (a *MinMaxAllocator) SetRange(min, max int) error
SetRange defines the range/pool with provided min and max values.
type Rangeable ¶
type Rangeable interface { Allocate(int) (bool, error) AllocateNext() (int, bool, error) Release(int) error Has(int) bool Free() int SetRange(min, max int) error }
Rangeable is an Interface that can adjust its min/max range. Rangeable should be threadsafe
Source Files ¶
doc.go glusterfs.go glusterfs_minmax.go glusterfs_util.go
- Version
- v1.11.0
- Published
- Jun 27, 2018
- Platform
- js/wasm
- Imports
- 27 packages
- Last checked
- 52 seconds ago –
Tools for package owners.