disk_resource

package
v0.0.0-...-598a827 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDiskFree

func GetDiskFree() (free uint64)

GetDiskFree is used to retrieve the amount of available disk space we have from a logical perspective with the headroom taken out

func GetPathFree

func GetPathFree(path string) (free uint64, err kv.Error)

GetPathFree will use the path supplied by the caller as the device context for which free space information is returned, this is from a pysical free capacity perspective rather than what the application is allowed to allocated which has to adjust for minimum amount free.

func InitDiskResource

func InitDiskResource(device string) (err kv.Error)

func SetDiskLimits

func SetDiskLimits(device string, minFree uint64) (avail uint64, err kv.Error)

SetDiskLimits is used to set a highwater mark for a device as a minimum free quantity

Types

type DiskAllocated

type DiskAllocated struct {
	Size uint64
	// contains filtered or unexported fields
}

DiskAllocated hold information about disk resources consumed on a specific device

func AllocDisk

func AllocDisk(maxSpace uint64, live bool) (alloc *DiskAllocated, err kv.Error)

AllocDisk will assigned a specified amount of space from a logical bucket for the default disk device. An error is returned if the available amount of disk is insufficient

func (*DiskAllocated) Release

func (alloc *DiskAllocated) Release() (err kv.Error)

Release will return assigned disk space back to the free pool of disk space for a default disk device. If the allocation is not recognized then an error is returned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL