tape

package
v0.0.0-...-c8a5df3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusTransfering denotes that the volume is currently being transfered by the
	// media changer.
	StatusTransfering uint32 = 1 << iota

	// StatusMounted is when the volume is mounted.
	StatusMounted

	// StatusNeedsCleaning tells us that the volume needs cleaning.
	StatusNeedsCleaning

	// StatusFormatted is set when the volume has already been formatted
	StatusFormatted
)

Variables

SlotCategories is a list of all valid slot types.

Functions

func FormatVolumeFlags

func FormatVolumeFlags(f uint32) string

FormatVolumeFlags formats the flags for human consumption.

Types

type Addr

type Addr int

Addr is an element/slot address in a store.

type ChangerConfig

type ChangerConfig struct {
	Driver  string
	Options map[string]string
}

ChangerConfig holds the configuration for a changer.

type Config

type Config struct {
	// The storage format ("ltfs", "bltfs", "raw")
	Format struct {
		Driver  string
		Options map[string]string
	}

	// CleaningPrefix is the prefix that identifies cleaning cartridges.
	CleaningPrefix string `yaml:"cleaning-prefix"`

	// Inventory is the inventory database configuration.
	Inventory struct {
		Driver  string
		Options map[string]string
	}

	// Changers contains configuration for the media changers.
	Changers map[string]ChangerConfig

	// Drives contains configuration for the drives.
	Drives struct {
		Format FormatConfig

		Read  map[string]DriveConfig
		Write map[string]DriveConfig
	}
}

Config is the tape config.

type DriveConfig

type DriveConfig struct {
	Slot int
	Path string
}

DriveConfig holds configuration for drives.

type FormatConfig

type FormatConfig struct {
	Backend string
	Options map[string]string
}

type Location

type Location struct {
	Addr     Addr
	Category SlotCategory
}

Location uniquely identifies a location within a store.

func (*Location) Scan

func (loc *Location) Scan(src interface{}) error

Scan implements sql.Scanner.

func (*Location) Value

func (loc *Location) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type Serial

type Serial string

A Serial is the volume serial number (VOLSER) of a tape.

type Slot

type Slot struct {
	Location

	// Volume returns the volume currently in this slot (if any).
	Volume *Volume
}

Slot is a slot in a store, represented by its element address.

func (*Slot) String

func (s *Slot) String() string

type SlotCategory

type SlotCategory int

SlotCategory is the type of slot (unknown, invalid, data transfer, storage or import/export).

const (
	// UnknownSlot represents slots which purpose is unknown.
	UnknownSlot SlotCategory = iota

	// InvalidSlot represents slots that are invalidly addressed.
	InvalidSlot

	// TransferSlot represents data transfer slots, usually inhabited
	// by a tape drive.
	TransferSlot

	// StorageSlot represents storage slots.
	StorageSlot

	// ImportExportSlot represents so-called mailbox slots for bulk import/export
	// of volumes to and from the silo.
	ImportExportSlot
)

func ToSlotCategory

func ToSlotCategory(str string) SlotCategory

ToSlotCategory returns the SlotCategory corresponding to the given string.

func (SlotCategory) String

func (cat SlotCategory) String() string

String implements fmt.Stringer.

func (SlotCategory) Value

func (cat SlotCategory) Value() (driver.Value, error)

Value implements driver.Valuer.

type SlotMap

type SlotMap map[Location]Volume

type Slots

type Slots []Slot

Slots is a list of slots.

type Volume

type Volume struct {
	// Serial is the Volume Serial (VOLSER).
	Serial Serial

	// Location is the current location in the store.
	Location Location

	// Home is the home location in the store.
	Home Location

	// Category tracks the volume state.
	Category VolumeCategory

	// Flags are contains temporary info on the volume.
	Flags uint32
}

A Volume is an usable volume.

func (*Volume) String

func (v *Volume) String() string

type VolumeCategory

type VolumeCategory int

VolumeCategory represents the volume category.

const (
	UnknownVolume VolumeCategory = iota
	Allocating
	Allocated
	Scratch
	Filling
	Full
	Missing
	Damaged
	Cleaning
)

Known volume categories.

func ToVolumeCategory

func ToVolumeCategory(str string) VolumeCategory

ToVolumeCategory returns the VolumeStatus corresponding to the given string.

func (*VolumeCategory) Scan

func (cat *VolumeCategory) Scan(src interface{}) error

Scan implements sql.Scanner.

func (VolumeCategory) String

func (cat VolumeCategory) String() string

String implements fmt.Stringer.

func (VolumeCategory) Value

func (cat VolumeCategory) Value() (driver.Value, error)

Value implements driver.Valuer.

Directories

Path Synopsis
fake
Package fake provides a fake tape.Changer.
Package fake provides a fake tape.Changer.
mtx
Package mtx provides a changer.Changer that uses the mtx command to control a SCSI media changer.
Package mtx provides a changer.Changer that uses the mtx command to control a SCSI media changer.
inv
postgres
Package postgres implements a PostgreSQL backed inv.Inventory.
Package postgres implements a PostgreSQL backed inv.Inventory.
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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