Documentation ¶
Overview ¶
package fs is for interacting with file systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedVolumeUsageCalculator ¶
type CachedVolumeUsageCalculator struct { UsageCalculator VolumeUsageCalculator // contains filtered or unexported fields }
CachedVolumeUsageCalculator wraps a VolumeUsageCalculator to provide an in-memory cache for the Size() method.
type CheckedVolumeUsageCalculator ¶
type CheckedVolumeUsageCalculator struct { // Retries is the number of attempts at getting the free space that should // be made, if the answer is 0 Retries int // Backoff determines the time waited in between attempts. It will be // Reset() when free space is greater than 0. Backoff *backoff.Backoff // UsageCalculator is an implementation of VolumeUsageCalculator. UsageCalculator VolumeUsageCalculator }
CheckedVolumeUsageCalculator wraps a VolumeUsageCalculator to confirm multiple times when free space on the volume is reported as 0, before returning that answer.
type Volume ¶
type Volume struct { // Dir is a directory path mounted on the volume of interest. "." is taken // to mean the current directory. Dir string // UsageCalculator is an implementation of VolumeUsageCalculator. UsageCalculator VolumeUsageCalculator }
Volume respresents a file system volume.
func (*Volume) NoSpaceLeft ¶
NoSpaceLeft tells you if the volume has no more space left (or is within 100MB of being full).
type VolumeUsageCalculator ¶
type VolumeUsageCalculator interface { // Size returns the size of the volume in bytes. Size(ctx context.Context, volumePath string) uint64 // Free returns the free space of the volume in bytes. Free(ctx context.Context, volumePath string) uint64 }
VolumeUsageCalculator has methods that provide volume usage information.
Directories ¶
Path | Synopsis |
---|---|
package local contains a local implementation of VolumeUsageCalculator.
|
package local contains a local implementation of VolumeUsageCalculator. |
package mock contains a mock implementation of VolumeUsageCalculator.
|
package mock contains a mock implementation of VolumeUsageCalculator. |
Click to show internal directories.
Click to hide internal directories.