Documentation
¶
Index ¶
- 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) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) PoolCharge() (string, int64)
- 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) 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 ¶
This section is empty.
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) 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) Provisioned ¶
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.