loop

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCapable

func IsCapable() bool

func WithLogger

func WithLogger(log *plog.Logger) funcopt.O

Types

type Info

type Info struct {
	LoopDevices []InfoEntry `json:"loopdevices"`
}

type InfoEntries

type InfoEntries []InfoEntry

func (InfoEntries) File

func (t InfoEntries) File(s string) *InfoEntry

func (InfoEntries) HasFile

func (t InfoEntries) HasFile(s string) bool

func (InfoEntries) Name

func (t InfoEntries) Name(s string) *InfoEntry

type InfoEntry

type InfoEntry struct {
	Name      string `json:"name"`      // "/dev/loop1"
	SizeLimit int64  `json:"sizelimit"` // 0
	Offset    int64  `json:"offset"`    // 0
	AutoClear bool   `json:"autoclear"` // true
	ReadOnly  bool   `json:"ro"`        // true
	BackFile  string `json:"back-file"` // "/var/lib/snapd/snaps/gnome-3-34-1804_66.snap"
	DirectIO  bool   `json:"dio"`       // false
	LogSec    int64  `json:"log-sec"`   // 512
}

type T

type T struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...funcopt.O) *T

func (T) Add

func (t T) Add(filePath string) error

func (T) Data

func (t T) Data() (InfoEntries, error)

func (T) Delete

func (t T) Delete(devPath string) error

func (T) FileDelete

func (t T) FileDelete(filePath string) error

func (T) FileExists

func (t T) FileExists(filePath string) (bool, error)

func (T) FileGet

func (t T) FileGet(filePath string) (*InfoEntry, error)

func (T) Get

func (t T) Get(name string) (*InfoEntry, error)

Jump to

Keyboard shortcuts

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