model

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice struct {
	Name       string
	MountPoint string
	FileSystem FileSystem
	Label      string
}

type BlockDeviceMetrics

type BlockDeviceMetrics struct {
	FileSystemSize  uint64
	BlockDeviceSize uint64
}

func (*BlockDeviceMetrics) ShouldResize

func (bdm *BlockDeviceMetrics) ShouldResize(threshold float64) bool

type Device added in v1.1.2

type Device struct {
	Name string
	Size uint64
}

type File

type File struct {
	Path     string
	Type     FileType
	DeviceId uint64
	InodeNo  uint64
	UserId
	GroupId
	Permissions FilePermissions
}

type FilePermissions

type FilePermissions uint32

func (FilePermissions) Perm

func (p FilePermissions) Perm() fs.FileMode

It is useful to be able to convert FilePermissions back into the fs.FileMode type which is expected by Go standard libraries

func (*FilePermissions) UnmarshalYAML

func (p *FilePermissions) UnmarshalYAML(unmarshal func(interface{}) error) error

Linux File Permission bits are typically represented as octals: e.g 0755. Some users may feel comfortable representing file permission bits as decimals: e.g 755. While the latter is not considered an octal, lets not punish them for a behaviour that has been ingrained by tools like chmod. `strconv.ParseUint` has the ability to force the intepreation of a string as a base-8 unsigned integer

type FileSystem

type FileSystem string
const (
	Unformatted FileSystem = ""
	Ext4        FileSystem = "ext4"
	Xfs         FileSystem = "xfs"
	Lvm         FileSystem = "LVM2_member"
)

func ParseFileSystem

func ParseFileSystem(s string) (FileSystem, error)

func (FileSystem) String

func (fs FileSystem) String() string

type FileType

type FileType uint32
const (
	RegularFile FileType = 1
	Directory   FileType = 2
	Special     FileType = 3
)

type Group

type Group struct {
	Name string
	Id   GroupId
}

type GroupId

type GroupId uint32

type LogicalVolume added in v1.1.0

type LogicalVolume struct {
	Name        string
	VolumeGroup string
	State       LvmState
	Size        uint64
}

type LvmKind added in v1.1.3

type LvmKind int32
const (
	DeviceKind         LvmKind = 0b0000001
	PhysicalVolumeKind LvmKind = 0b0000010
	VolumeGroupKind    LvmKind = 0b0000100
	LogicalVolumeKind  LvmKind = 0b0010000
)

type LvmState added in v1.1.3

type LvmState int32
const (
	DeviceActive             LvmState = 0b0000001
	PhysicalVolumeActive     LvmState = 0b0000010
	VolumeGroupInactive      LvmState = 0b0000100
	VolumeGroupActive        LvmState = 0b0001100
	LogicalVolumeInactive    LvmState = 0b0010000
	LogicalVolumeActive      LvmState = 0b0110000
	LogicalVolumeUnsupported LvmState = 0b1110000
)

type Mode

type Mode string
const (
	Empty       Mode = ""
	Healthcheck Mode = "healthcheck"
	Prompt      Mode = "prompt"
	Force       Mode = "force"
)

func ParseMode

func ParseMode(s string) (Mode, error)

type MountOptions

type MountOptions string

func (MountOptions) Remount

func (mop MountOptions) Remount() MountOptions

type PhysicalVolume added in v1.1.0

type PhysicalVolume struct {
	Name string
	Size uint64
}

type User

type User struct {
	Name string
	Id   UserId
}

type UserId

type UserId uint32

type VolumeGroup added in v1.1.0

type VolumeGroup struct {
	Name           string
	PhysicalVolume string
	Size           uint64
	State          LvmState
}

Jump to

Keyboard shortcuts

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