swap

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package swap probes Linux swapspaces.

Index

Constants

View Source
const SWAPHEADER_SIZE = 516

SWAPHEADER_SIZE is the size of the SwapHeader struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe struct{}

Probe for the filesystem.

func (*Probe) Magic

func (p *Probe) Magic() []*magic.Magic

Magic returns the magic value for the filesystem.

func (*Probe) Name

func (p *Probe) Name() string

Name returns the name of the filesystem.

func (*Probe) Probe

func (p *Probe) Probe(r probe.Reader, m magic.Magic) (*probe.Result, error)

Probe runs the further inspection and returns the result if successful.

type SwapHeader

type SwapHeader []byte

SwapHeader is a byte slice representing the swap_header.h C header.

func (SwapHeader) Get_lastpage

func (s SwapHeader) Get_lastpage() uint32

Get_lastpage returns lastpage.

func (SwapHeader) Get_nr_badpages

func (s SwapHeader) Get_nr_badpages() uint32

Get_nr_badpages returns nr_badpages.

func (SwapHeader) Get_uuid

func (s SwapHeader) Get_uuid() []byte

Get_uuid returns uuid.

func (SwapHeader) Get_version

func (s SwapHeader) Get_version() uint32

Get_version returns version.

func (SwapHeader) Get_volume

func (s SwapHeader) Get_volume() []byte

Get_volume returns volume.

func (SwapHeader) Put_lastpage

func (s SwapHeader) Put_lastpage(v uint32)

Put_lastpage sets lastpage.

func (SwapHeader) Put_nr_badpages

func (s SwapHeader) Put_nr_badpages(v uint32)

Put_nr_badpages sets nr_badpages.

func (SwapHeader) Put_uuid

func (s SwapHeader) Put_uuid(v []byte)

Put_uuid sets uuid.

func (SwapHeader) Put_version

func (s SwapHeader) Put_version(v uint32)

Put_version sets version.

func (SwapHeader) Put_volume

func (s SwapHeader) Put_volume(v []byte)

Put_volume sets volume.

Jump to

Keyboard shortcuts

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