losetup

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOSETUP_COMMAND = "losetup"
)

Variables

This section is empty.

Functions

func DetachDevice

func DetachDevice(devPath string) error

func DetachDeviceByFile

func DetachDeviceByFile(filePath string) error

func GetUnusedDevice

func GetUnusedDevice() (string, error)

Types

type Command

type Command struct {
	Path string
	Args []string
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(path string, args ...string) *Command

func (*Command) AddArgs

func (cmd *Command) AddArgs(args ...string) *Command

func (*Command) Output

func (cmd *Command) Output() string

func (*Command) Run

func (cmd *Command) Run() (*Command, error)

type Device

type Device struct {
	Name      string `json:"name"`
	BackFile  string `json:"back-file"`
	SizeLimit bool   `json:"sizelimit"`
	//Offset    string `json:"offset"`
	//AutoClear string `json:"autoclear"`
	ReadOnly bool `json:"ro"`
}

func AttachDevice

func AttachDevice(filePath string, partScan bool) (*Device, error)

type Devices

type Devices struct {
	LoopDevs []Device `json:"loopdevices"`
}

func ListDevices

func ListDevices() (*Devices, error)

func (Devices) GetDeviceByFile

func (devs Devices) GetDeviceByFile(filePath string) *Device

func (Devices) GetDeviceByName

func (devs Devices) GetDeviceByName(name string) *Device

type LosetupCommand

type LosetupCommand struct {
	*Command
}

func NewLosetupCommand

func NewLosetupCommand() *LosetupCommand

Jump to

Keyboard shortcuts

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