fs

package
v0.0.0-...-21a838e Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2014 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

+build linux

Provides Filesystem Stats

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceInfo

type DeviceInfo struct {
	Device string
	Major  uint
	Minor  uint
}

type Fs

type Fs struct {
	DeviceInfo
	Capacity uint64
	Free     uint64
}

type FsInfo

type FsInfo interface {
	// Returns capacity and free space, in bytes, of all the ext2, ext3, ext4 filesystems on the host.
	GetGlobalFsInfo() ([]Fs, error)

	// Returns number of bytes occupied by 'dir'.
	GetDirUsage(dir string) (uint64, error)

	// Returns the block device info of the filesystem on which 'dir' resides.
	GetDirFsDevice(dir string) (*DeviceInfo, error)
}

func NewFsInfo

func NewFsInfo() (FsInfo, error)

type RealFsInfo

type RealFsInfo struct {
	// contains filtered or unexported fields
}

func (*RealFsInfo) GetDirFsDevice

func (self *RealFsInfo) GetDirFsDevice(dir string) (*DeviceInfo, error)

func (*RealFsInfo) GetDirUsage

func (self *RealFsInfo) GetDirUsage(dir string) (uint64, error)

func (*RealFsInfo) GetGlobalFsInfo

func (self *RealFsInfo) GetGlobalFsInfo() ([]Fs, error)

Jump to

Keyboard shortcuts

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