mapper

package
v2.2.0-pre Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

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

Mapper handles actions for formating and mapping crypt devices.

func New

func New(path string, log *logger.Logger) (*Mapper, error)

New creates a new crypt device for the device at path.

func (*Mapper) Close

func (m *Mapper) Close() error

Close closes and frees memory allocated for the crypt device.

func (*Mapper) DiskUUID

func (m *Mapper) DiskUUID() string

DiskUUID gets the device's UUID.

func (*Mapper) FormatDisk

func (m *Mapper) FormatDisk(passphrase string) error

FormatDisk formats the disk and adds passphrase in keyslot 0.

func (*Mapper) IsLUKSDevice

func (m *Mapper) IsLUKSDevice() bool

IsLUKSDevice returns true if the device is formatted as a LUKS device.

func (*Mapper) MapDisk

func (m *Mapper) MapDisk(target, passphrase string) error

MapDisk maps a crypt device to /dev/mapper/target using the provided passphrase.

func (*Mapper) UnmapDisk

func (m *Mapper) UnmapDisk(target string) error

UnmapDisk removes the mapping of target.

func (*Mapper) Wipe

func (m *Mapper) Wipe(blockWipeSize int) error

Wipe overwrites the device with zeros to initialize integrity checksums.

Jump to

Keyboard shortcuts

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