filesystem

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Etc

type Etc struct{}

Etc represents the /etc filesystem.

func (*Etc) OSRelease

func (*Etc) OSRelease() map[string]string

OSRelease read from /etc/os-release.

type Proc

type Proc struct{}

Proc represents the /proc filesystem.

func (*Proc) CGroup

func (*Proc) CGroup() string

CGroup read from /proc/self/cgroup.

func (*Proc) CPUInfo

func (*Proc) CPUInfo() string

CPUInfo read from /proc/cpuinfo.

func (*Proc) Environ

func (*Proc) Environ() string

Environ read from /proc/1/environ.

func (*Proc) MemInfo

func (*Proc) MemInfo() map[string]int64

MemInfo read from /proc/meminfo, strip "kB" from endings and convert to int64.

func (*Proc) OSRelease

func (*Proc) OSRelease() string

OSRelease read from /proc/sys/kernel/osrelease.

func (*Proc) Procinfo

func (*Proc) Procinfo() string

Procinfo read from /proc/procinfo.

func (*Proc) Version

func (*Proc) Version() string

Version read from /proc/version.

type Run

type Run struct{}

Run represents the /run filesystem.

func (*Run) ContainerEnv

func (*Run) ContainerEnv() bool

ContainerEnv bool if /run/.containerenv exists.

func (*Run) DockerEnv

func (*Run) DockerEnv() bool

DockerEnv bool if /run/.dockerenv exists.

type Sys

type Sys struct{}

Sys represents the /sys filesystem.

func (*Sys) BIOSDate

func (*Sys) BIOSDate() string

BIOSDate read from /sys/class/dmi/id.

func (*Sys) BIOSVendor

func (*Sys) BIOSVendor() string

BIOSVendor read from /sys/class/dmi/id.

func (*Sys) BIOSVersion

func (*Sys) BIOSVersion() string

BIOSVersion read from /sys/class/dmi/id.

func (*Sys) BlockSize

func (s *Sys) BlockSize(target string) int64

BlockSize reads from a size file for a storage device. The values return the number of blocks, so the value returned is multiplied by 512 to return the actual size.

func (*Sys) BoardName

func (*Sys) BoardName() string

BoardName read from /sys/class/dmi/id/.

func (*Sys) BoardVendor

func (*Sys) BoardVendor() string

BoardVendor read from /sys/class/dmi/id/.

func (*Sys) CPUCoreList

func (s *Sys) CPUCoreList() []string

CPUCoreList returns a unique list of CPUs with the same physical core file returns a list of cores with the same physical core (e.g. 0, or 0,7).

func (*Sys) CPUSocketMap

func (s *Sys) CPUSocketMap() map[string]int

CPUSocketMap returns a map of CPU to Socket.

func (*Sys) ChassisAssetTag

func (*Sys) ChassisAssetTag() string

ChassisAssetTag read from /sys/class/dmi/id/.

func (*Sys) HypervisorType

func (*Sys) HypervisorType() string

HypervisorType read from /sys/hypervisor/.

func (*Sys) HypervisorUUID

func (*Sys) HypervisorUUID() string

HypervisorUUID read from /sys/hypervisor/.

func (*Sys) ListBlock

func (s *Sys) ListBlock() []string

ListBlock returns lists all block devices in /sys.

func (*Sys) ListCPU

func (s *Sys) ListCPU() []string

ListCPU returns a list of all CPUs in /sys.

func (*Sys) ListNetwork

func (s *Sys) ListNetwork() []string

ListNetwork returns a list of all network devices in /sys.

func (*Sys) ProductName

func (*Sys) ProductName() string

ProductName read from /sys/class/dmi/id/.

func (*Sys) ProductSerial

func (*Sys) ProductSerial() string

ProductSerial read from /sys/class/dmi/id/.

func (*Sys) ReadInt

func (*Sys) ReadInt(target string) int

ReadInt returns an int from a file.

func (*Sys) ReadInt64

func (*Sys) ReadInt64(target string) int64

ReadInt64 returns a in64 from a file.

func (*Sys) ReadString

func (*Sys) ReadString(target string) string

ReadString returns a string from a file.

func (*Sys) SysVendor

func (*Sys) SysVendor() string

SysVendor read from /sys/class/dmi/id/.

func (*Sys) UEvent

func (s *Sys) UEvent(target string) map[string]string

UEvent reads from the target's uevent file and parses it.

Jump to

Keyboard shortcuts

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