Documentation ¶
Overview ¶
Package volume contains some types associated with GlusterFS volumes that will be used in GlusterD
Index ¶
- Variables
- func AddOrUpdateVolume(v *Volinfo) error
- func DeleteVolume(name string) error
- func Exists(name string) bool
- func GetVolumesList() (map[string]uuid.UUID, error)
- func RemoveBrickPaths(bricks []Brickinfo) error
- func ValidateBrickEntries(bricks []Brickinfo, volID uuid.UUID, force bool) (int, error)
- type Brickinfo
- type VolCreateRequest
- type VolStatus
- type VolType
- type Volinfo
Constants ¶
This section is empty.
Variables ¶
var ( ExistsFunc = Exists AddOrUpdateVolumeFunc = AddOrUpdateVolume )
var ( ValidateBrickEntriesFunc = ValidateBrickEntries NewVolinfoFunc = NewVolinfo NewBrickEntriesFunc = NewBrickEntries )
Functions ¶
func AddOrUpdateVolume ¶
AddOrUpdateVolume marshals to volume object and passes to store to add/update
func DeleteVolume ¶
DeleteVolume passes the volname to store to delete the volume object
func RemoveBrickPaths ¶
RemoveBrickPaths is to clean up the bricks in case commit fails for volume create
Types ¶
type Brickinfo ¶
Brickinfo represents the information of a brick
func NewBrickEntries ¶
NewBrickEntries creates the brick list
type VolCreateRequest ¶
type VolCreateRequest struct { Name string `json:"name"` Transport string `json:"transport,omitempty"` DistCount uint64 `json:"distcount,omitempty"` ReplicaCount uint16 `json:"replica,omitempty"` StripeCount uint16 `json:"stripecount,omitempty"` DisperseCount uint16 `json:"dispersecount,omitempty"` RedundancyCount uint16 `json:"redundancycount,omitempty"` Bricks []string `json:"bricks"` Force bool `json:"force,omitempty"` }
VolCreateRequest defines the parameters for creating a volume in the volume-create command TODO: This should probably be moved out of here.
type VolType ¶
type VolType uint16
VolType is the status of the volume
const ( // Distribute is a plain distribute volume Distribute VolType = iota // Replicate is plain replicate volume Replicate // Stripe is a plain stripe volume Stripe // Disperse is a plain erasure coded volume Disperse // DistReplicate is a distribute-replicate volume DistReplicate // DistStripe is a distribute-stripe volume DistStripe // DistDisperse is a distribute-'erasure coded' volume DistDisperse // DistRepStripe is a distribute-replicate-stripe volume DistRepStripe // DistDispStripe is distrbute-'erasure coded'-stripe volume DistDispStripe )
type Volinfo ¶
type Volinfo struct { ID uuid.UUID Name string Type VolType Transport string DistCount uint64 ReplicaCount uint16 StripeCount uint16 DisperseCount uint16 RedundancyCount uint16 Options map[string]string Status VolStatus Checksum uint64 Version uint64 Bricks []Brickinfo }
Volinfo repesents a volume
func GetVolume ¶
GetVolume fetches the json object from the store and unmarshalls it into volinfo object
func GetVolumes ¶
GetVolumes retrives the json objects from the store and converts them into respective volinfo objects
func NewVolumeEntry ¶
func NewVolumeEntry(req *VolCreateRequest) (*Volinfo, error)
NewVolumeEntry returns an initialized Volinfo using the given parameters