Documentation ¶
Overview ¶
fsstatus provides utility functions for querying several aspects of the filesystem, especially as pertains to monitoring.
Index ¶
- func Checksum(algorithm string, data []byte) (checksum string, err error)
- func FileHasPermissions(expectedPerms string, path string) (bool, error)
- func FreeInodes(filesystem string) (free uint64, err error)
- func IsDirectory(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func IsSymlink(path string) (bool, error)
- func PercentInodesUsed(filesystem string) (percent uint8, err error)
- func TotalInodes(filesystem string) (total uint64, err error)
- func UsedInodes(filesystem string) (used uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Checksum ¶
Checksum returns the checksum of some data, using a specified algorithm. It only returns an error when an invalid algorithm is used. The valid ones are MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3224, SHA3256, SHA3384, and SHA3512.
func FileHasPermissions ¶
FileHasPermissions checks to see whether the file/directory/etc. at the given path has the given permissions (of the format -rwxrwxrwx)
func FreeInodes ¶ added in v0.2.3
FreeInodes reports the number of free inodes in a given filesystem, e.g. /dev/sda1, as given by `df -i`
func IsDirectory ¶
IsDirectory checks to see if there's a regular ol' directory at path.
func PercentInodesUsed ¶ added in v0.2.3
PercentInodesUsed reports the percentage given by `df -i`, which is ceilinged to the next integer value, so a percent like .001% would round to 1%.
func TotalInodes ¶ added in v0.2.3
TotalInodes is like FreeInodes
func UsedInodes ¶ added in v0.2.3
UsedInodes is like FreeInodes
Types ¶
This section is empty.