inv

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fn InventoryConstructor) error

Register registers a new inv.Inventory implementation.

Types

type Inventory

type Inventory interface {
	// Load transfers a volume to a drive in the context of
	// the given tape.
	Load(tape.Serial, tape.Location, changer.Changer) error

	// Unload transfers a volume from a drive in the context of
	// the given tape.
	Unload(tape.Serial, tape.Location, changer.Changer) error

	// Transfer transfers a volume to a location in the context of
	// the given tape.
	Transfer(tape.Serial, tape.Location, changer.Changer) error

	// Audit performs an inventory audit by inspecting the physical state of the
	// backing tape and makes sure the inventory reflects that state.
	Audit(changer.Changer) error

	// Alloc allocates a filling (or scratch) volume from the inventory
	// and mounts it into the device at the given destination.
	Alloc() (tape.Serial, error)

	// Loaded returns whether or not the given drive is loaded.
	Loaded(tape.Location) (bool, tape.Serial, error)

	// Status returns a list of known volumes.
	Volumes() ([]tape.Volume, error)

	// Update updates volume information
	Update(tape.Volume) error

	// Info retrieves info about a volume.
	Info(tape.Serial) (tape.Volume, error)

	// Reset resets the inventory database.
	Reset() error

	// Lookup looks up the given path name and returns a list of volumes that
	// contains the file/directory.
	Lookup(tapr.PathName) (tape.Volume, error)

	// Create creates a new node in the directory tree located on the volume
	// associated with the given volume serial.
	Create(path tapr.PathName, serial string) error
}

An Inventory tracks volumes in a tape store. An inventory MUST be safe for concurrent use.

func Create

func Create(name string, cfg map[string]string) (Inventory, error)

Create creates a new Inventory using the named implementation.

type InventoryConstructor

type InventoryConstructor func(map[string]string) (Inventory, error)

InventoryConstructor is a function that creates an Inventory.

Directories

Path Synopsis
Package postgres implements a PostgreSQL backed inv.Inventory.
Package postgres implements a PostgreSQL backed inv.Inventory.

Jump to

Keyboard shortcuts

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