Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection is a data structure used for tracking live mounts.
func NewCollection ¶
func NewCollection() *Collection
NewCollection properly initializes the Collection struct.
func (*Collection) Add ¶
func (c *Collection) Add(mc *storage.Mount)
Add adds a mount to the collection. It is assumed that volplugin will manage the pre-existence of a live mount for the purposes of this function and this function WILL panic w/ error if given an existing mount as a duplicate.
func (*Collection) Get ¶
func (c *Collection) Get(vol string) (*storage.Mount, error)
Get obtains the mount from the collection
func (*Collection) Remove ¶
func (c *Collection) Remove(vol string)
Remove removes a mount from the mount collection.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements a tracker for specific mounts.
Each volume is assigned an integer and that integer is atomically incremented. This is used to track how many mounts a specific volume has on a given host. This is used to control mounting and heal the system if necessary.
func (*Counter) AddCount ¶
AddCount adds n to the mount counter for a volume name and returns the new value.