mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-03 11:45:21 +00:00
25 lines
432 B
Go
25 lines
432 B
Go
package tapechanger
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/samuelncui/yatm/library"
|
|
)
|
|
|
|
var (
|
|
tapeChangers map[string]func(dsn string) (TapeChanger, error)
|
|
)
|
|
|
|
type Tape struct {
|
|
*library.Tape
|
|
MountPoint string
|
|
}
|
|
|
|
type TapeChanger interface {
|
|
Change(ctx context.Context, target *library.Tape) (*Tape, error)
|
|
}
|
|
|
|
func RegisterTapeChanger(schema string, factory func(dsn string) (TapeChanger, error)) {
|
|
tapeChangers[schema] = factory
|
|
}
|