fsstatus

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

fsstatus provides utility functions for querying several aspects of the filesystem, especially as pertains to monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(algorithm string, data []byte) (checksum string, err error)

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

func FileHasPermissions(expectedPerms string, path string) (bool, error)

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

func FreeInodes(filesystem string) (free uint64, err error)

FreeInodes reports the number of free inodes in a given filesystem, e.g. /dev/sda1, as given by `df -i`

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory checks to see if there's a regular ol' directory at path.

func IsFile

func IsFile(path string) (bool, error)

IsFile checks to see if there's a regular ol' file at path.

func IsSymlink(path string) (bool, error)

IsSymlink checks to see if there's a symlink at path.

func PercentInodesUsed added in v0.2.3

func PercentInodesUsed(filesystem string) (percent uint8, err error)

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

func TotalInodes(filesystem string) (total uint64, err error)

TotalInodes is like FreeInodes

func UsedInodes added in v0.2.3

func UsedInodes(filesystem string) (used uint64, err error)

UsedInodes is like FreeInodes

Types

This section is empty.

Jump to

Keyboard shortcuts

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