filesystem

package
v0.0.0-...-3f8e3b8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package filesystem returns information about available filesystems.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrTimeoutExceeded represents a timeout error
	ErrTimeoutExceeded = errors.New("timeout exceeded")
)

Functions

This section is empty.

Types

type Info

type Info []MountInfo

Info represents a list of mounted filesystems.

func CollectInfo

func CollectInfo() (Info, error)

CollectInfo returns the list of mounted filesystems

func (Info) AsJSON

func (mounts Info) AsJSON() (interface{}, []string, error)

AsJSON returns an interface which can be marshalled to a JSON and contains the value of non-errored fields.

type MountInfo

type MountInfo struct {
	// Name is the name of the mounted filesystem.
	Name string `json:"name"`
	// SizeKB is the size of the mounted filesystem in KB.
	SizeKB uint64 `json:"kb_size"`
	// MountedOn is the mount point path of the mounted filesystem.
	MountedOn string `json:"mounted_on"`
}

MountInfo represents a mounted filesystem.

Jump to

Keyboard shortcuts

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