drivedb

package
v0.0.0-...-6bd98cc Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrConv

type AttrConv struct {
	Conv string `yaml:"conv"`
	Name string `yaml:"name"`
}

SMART attribute conversion rule

type DriveDb

type DriveDb struct {
	Drives []DriveModel `yaml:"drives"`
}

func OpenDriveDb

func OpenDriveDb(dbfile string) (DriveDb, error)

OpenDriveDb opens a YAML-formatted drive database, unmarshalls it, and returns a DriveDb.

func (*DriveDb) LookupDrive

func (db *DriveDb) LookupDrive(ident []byte) DriveModel

LookupDrive returns the most appropriate DriveModel for a given ATA IDENTIFY value.

type DriveModel

type DriveModel struct {
	Family         string              `yaml:"family"`
	ModelRegex     string              `yaml:"model_regex"`
	FirmwareRegex  string              `yaml:"firmware_regex"`
	WarningMsg     string              `yaml:"warning"`
	Presets        map[string]AttrConv `yaml:"presets"`
	CompiledRegexp *regexp.Regexp
}

Jump to

Keyboard shortcuts

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