Documentation
¶
Overview ¶
Package mtx provides functions for working with an automated library changer.
It includes two subpackages, scsi and mock. scsi calls the 'mtx' program and mock simulates the use of 'mtx' if no library changer is available doing testing/development.
Index ¶
- type Changer
- func (chgr *Changer) Drives() ([]*Slot, error)
- func (chgr *Changer) Load(slotnum, drivenum int) error
- func (chgr *Changer) MailSlots() ([]*Slot, error)
- func (chgr *Changer) MaxDrives() (int, error)
- func (chgr *Changer) NumMailSlots() (int, error)
- func (chgr *Changer) NumSlots() (int, error)
- func (chgr *Changer) NumStorageSlots() (int, error)
- func (chgr *Changer) Slots() ([]*Slot, error)
- func (chgr *Changer) Status() (*Status, error)
- func (chgr *Changer) StorageSlots() ([]*Slot, error)
- func (chgr *Changer) Transfer(slotnum, drivenum int) error
- func (chgr *Changer) Unload(slotnum, drivenum int) error
- type Interface
- type Slot
- type SlotType
- type Status
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changer ¶
type Changer struct {
Interface
}
Changer represents a library changer.
func NewChanger ¶
NewChanger returns a new library changer using the given implementation.
func (*Changer) Drives ¶
Drives returns a slice of data transfer elements. Note that data transfer slots typically start with slot id 0.
func (*Changer) MailSlots ¶
MailSlots returns a slice of storage elements. Note that mail slots typically start with slot ids counting from the id of the last storage slot.
func (*Changer) MaxDrives ¶
MaxDrives returns the number of data transfer elements. Note that this does not necessary correspond to the number of actual drives present in the system.
func (*Changer) NumMailSlots ¶
NumMailSlots returns the number of mail slots.
func (*Changer) NumStorageSlots ¶
NumStorageSlots returns the number of storage slots.
func (*Changer) Slots ¶
Slots returns a slice of storage and mail elements. Note that storage slots typically start with slot id 1 and not 0.
func (*Changer) Status ¶
Status returns a Status structure with combined information about the status of the library.
func (*Changer) StorageSlots ¶
StorageSlots returns a slice of storage elements. Note that storage slots typically start with slot id 1 and not 0.
type Interface ¶
type Interface interface {
// Do performs the raw operation identified by cmd.
Do(args ...string) ([]byte, error)
}
The Interface interface describes operations supported by a library auto changer.
type Slot ¶
type Slot struct {
// The Slot number inside the library.
Num int
// Type is the slot type.
Type SlotType
// If a volume is in the slot, Vol will be non-nil.
Vol *Volume
}
Slot represents a slot in the library.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock implements a mocked library auto changer that simulates 'mtx'.
|
Package mock implements a mocked library auto changer that simulates 'mtx'. |
|
Package scsi implements the mtx.Interface for a scsi library auto changer by using the 'mtx' program.
|
Package scsi implements the mtx.Interface for a scsi library auto changer by using the 'mtx' program. |