Documentation
¶
Index ¶
- Variables
- func New() resource.Driver
- type T
- func (t *T) CanInstall(ctx context.Context) (bool, error)
- func (t *T) Configure() error
- func (t *T) CurrentSize(ctx context.Context) (int64, error)
- func (t *T) DriverID() driver.ID
- func (t *T) Head() string
- func (t *T) Holds(src resource.HoldSource) []resource.Hold
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) PoolCharge() (string, int64)
- func (t *T) ProjectQuotaUsage(ctx context.Context) (used, hard int64, ok bool, err error)
- func (t *T) Provision(ctx context.Context) error
- func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)
- func (t *T) Resize(ctx context.Context, to int64) error
- func (t *T) ResizeHandsOut(_ context.Context) (func(below int64) int64, error)
- func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)
- func (t *T) SizeInfoKey() string
- func (t *T) Start(ctx context.Context) error
- func (t *T) Status(ctx context.Context) status.T
- func (t *T) Stop(ctx context.Context) error
- func (t *T) Unprovision(ctx context.Context) error
- func (t *T) UnprovisionAsLeader(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // GroupDirectory holds the directory the resource creates. It has the // order of the device group of the filesystems mounted, which says // what they are too. GroupDirectory = keywords.Group{ ID: "directory", Name: "Directory", Text: keywords.NewText(fs, "text/group/directory"), Order: 10, } // GroupSize holds the project quota bounding what the directory // holds. It has the id, name and order of the size group of the // filesystems mounted. GroupSize = keywords.Group{ ID: "size", Name: "Size", Text: keywords.NewText(fs, "text/group/size"), Order: 28, } )
The groups of the keywords of a directory beside the ones of the datarecv keywords, which hold its owner and permissions and the files installed in it.
Functions ¶
Types ¶
type T ¶
type T struct {
resource.T
resource.Restart
datarecv.DataRecv
Path naming.Path `json:"-"`
DirPath string `json:"path"`
Size *int64 `json:"size"`
ProjectID int `json:"project_id"`
}
func (*T) CurrentSize ¶
CurrentSize implements resource.Sizer.
A directory given a size of its own reports what its project quota lets it hold. One without has no size of its own: what it may hold is what the filesystem holding it has, which is what a directory pool reports as the usage of the volumes it serves.
func (*T) Head ¶
Head returns the path of the directory on the node, whether the volume it is in is available or not, and empty when the path names nothing.
func (*T) Holds ¶
func (t *T) Holds(src resource.HoldSource) []resource.Hold
Holds says the directory, as a mount point is: another object mounting on it, or managing it, would take it. A directory in a volume, written volume#<n>:/<path> or <vol name>/<path>, is held by the volume.
func (*T) PoolCharge ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource PoolCharge implements resource.PoolCharger. A directory takes of the directory it is made in, and takes the size it is bounded to.
A directory with no size is bounded by nothing, and what it takes is not a number anything can be rationed by.
func (*T) ProjectQuotaUsage ¶
ProjectQuotaUsage implements resource.ProjectQuotaUser: what the project quota of the directory counts, and bounds it to, ok false for a directory with no size of its own.
func (*T) Provisioned ¶
func (*T) ResizeHandsOut ¶
ResizeHandsOut implements resource.ResizeHandsOuter.
A quota is a limit, not an allocation, so no resource of a chain is below it: it is the bottom, and is asked for the size a chain is given. It hands out what it is given.
func (*T) ResizePlan ¶
ResizePlan implements resource.Resizer.
A quota is a limit, not an allocation, so there is nothing below to ask anything of. It is also why a shrink is checked here: lowering a limit under what the tree already holds does not fail, it silently breaks the next write, so it is refused while the chain is still being planned.
func (*T) SizeInfoKey ¶
SizeInfoKey implements resource.SizeInfoKeyer.
A directory given a size of its own reports it as a size. One without takes the size of the filesystem holding it, and calling that "size" next to "driver fs.directory" reads as the size of the directory.
func (*T) UnprovisionAsLeader ¶
UnprovisionAsLeader removes the directory, which is what provisioning it made. The provision keyword set to false is how an owner keeps a directory that om3 is only to create and never to remove.
A quota-backed directory has its project limit dropped with it, or the filesystem keeps a limit on a project nothing is stamped with any more.