storage

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	Name       string      `json:"name"`
	Size       string      `json:"size"`
	Bytes      int64       `json:"bytes"`
	Path       string      `json:"path"`
	Partitions []Partition `json:"partitions"`
}

Disk captures information about physical disks.

type Partition

type Partition struct {
	Number      string `json:"number"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Size        string `json:"size"`
	Bytes       int64  `json:"bytes"`
	Path        string `json:"path"`
}

Partition captures information about partitions on disks.

type Probe

type Probe struct {
	Disks []Disk `json:"disks"`
	// contains filtered or unexported fields
}

Probe struct for storage. Captures disks, which capture partitions.

func New

func New() (*Probe, error)

New initializes new probe struct and probes the system.

func (*Probe) JSON

func (p *Probe) JSON() string

JSON representation of the struct.

func (*Probe) Partitions

func (p *Probe) Partitions(parentDevName string) []Partition

Partitions returns all partitions for a particular device.

func (*Probe) String

func (p *Probe) String() string

String representation of the struct.

Jump to

Keyboard shortcuts

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