drive

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPartitionPath

func GetPartitionPath(devicePath string, partitionNumber int) string

Types

type Partition

type Partition struct {
	Label         string
	PartitionPath string
	Size          int
}

type SfdiskDeviceInfo

type SfdiskDeviceInfo struct {
	Paritiontable struct {
		Label      string            `json:"label"`
		Unit       string            `json:"unit"`
		SectorSize int               `json:"sectorsize"`
		DevicePath string            `json:"device"`
		LbaStart   int               `json:"firstlba"`
		LbaEnd     int               `json:"lastlba"`
		Partitions []SfdiskPartition `json:"partitions"`
	} `json:"partitiontable"`
}

func GetDeviceInfo

func GetDeviceInfo(devicePath string) (SfdiskDeviceInfo, error)

type SfdiskPartition

type SfdiskPartition struct {
	Label         string `json:"name"`
	PartitionPath string `json:"node"`
	Sectors       int    `json:"size"`
	Type          string `json:"type"`
	Uuid          string `json:"uuid"`
}

type StorageDevice

type StorageDevice struct {
	Label      string
	DevicePath string
	Size       int
	Partitions []Partition
}

func GetStorageDevicesList

func GetStorageDevicesList() ([]StorageDevice, error)

Jump to

Keyboard shortcuts

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