Documentation ¶
Index ¶
- func DisplayConfig(cfg interface{}) string
- func LoadConfig(cfgFile string, cfg interface{}) error
- type Action
- type ActionHandler
- type Archiver
- type Config
- type DataMoverClient
- type Fataler
- type Mover
- type Plugin
- type Remover
- type Restorer
- type TestAction
- func (a *TestAction) Complete() error
- func (a *TestAction) Data() []byte
- func (a *TestAction) Fail(err error) error
- func (a *TestAction) Hash() []byte
- func (a *TestAction) ID() uint64
- func (a *TestAction) Length() int64
- func (a *TestAction) Offset() int64
- func (a *TestAction) PrimaryPath() string
- func (a *TestAction) SetActualLength(length int64)
- func (a *TestAction) SetHash(id []byte)
- func (a *TestAction) SetURL(u string)
- func (a *TestAction) SetUUID(u string)
- func (a *TestAction) URL() string
- func (a *TestAction) UUID() string
- func (a *TestAction) Update(offset, length, max int64) error
- func (a *TestAction) WritePath() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayConfig ¶
func DisplayConfig(cfg interface{}) string
DisplayConfig formats the configuration into string for display purposes. A helper function to remove some duplicate code in movers.
func LoadConfig ¶
LoadConfig reads this plugin's config file and decodes it into the passed config struct.
Types ¶
type Action ¶
type Action interface { // Update sends an action status update Update(offset, length, max int64) error // ID returns the action item's ID ID() uint64 // Offset returns the current offset of the action item Offset() int64 // Length returns the expected length of the action item's file Length() int64 // Data returns a byte slice of the action item's data Data() []byte // PrimaryPath returns the action item's primary file path PrimaryPath() string // WritePath returns the action item's write path (e.g. for restores) WritePath() string // UUID returns the action item's file id UUID() string // Hash returns the action item's file id Hash() []byte // URL returns the action item's file id URL() string // SetUUID sets the action's file id SetUUID(id string) // SetHash sets the action's file id SetHash(hash []byte) // SetURL sets the action's file id SetURL(id string) // SetActualLength sets the action's actual file length SetActualLength(length int64) }
Action defines an interface for dm actions
type ActionHandler ¶
ActionHandler is function that implements one of the commands
type Archiver ¶
Archiver defines an interface for data movers capable of fulfilling Archive requests
type DataMoverClient ¶
type DataMoverClient struct {
// contains filtered or unexported fields
}
DataMoverClient is the data mover client to the HSM agent
func NewMover ¶
func NewMover(plugin *Plugin, cli pb.DataMoverClient, config *Config) *DataMoverClient
NewMover returns a new *DataMoverClient
func (*DataMoverClient) Run ¶
func (dm *DataMoverClient) Run(ctx context.Context)
Run begins listening for and processing incoming action items
type Fataler ¶
type Fataler interface { Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) }
Fataler provides Fatal and Fatalf
type Mover ¶
type Mover interface {
Start()
}
Mover defines an interface for data mover implementations
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin manages communication between the HSM agent and the datamover
func (*Plugin) ConfigFile ¶
ConfigFile returns path to the plugin config file.
type Restorer ¶
Restorer defines an interface for data movers capable of fulfilling Restore requests
type TestAction ¶
TestAction is an Action implementation used for testing Movers.
func NewTestAction ¶
func NewTestAction(t Fataler, path string, offset int64, length int64, uuid string, data []byte) *TestAction
NewTestAction returns a stub action that can be used for testing.
func (*TestAction) Complete ¶
func (a *TestAction) Complete() error
Complete signals that the action has completed
func (*TestAction) Data ¶
func (a *TestAction) Data() []byte
Data returns a byte slice of the action item's data
func (*TestAction) Fail ¶
func (a *TestAction) Fail(err error) error
Fail signals that the action has failed
func (*TestAction) Length ¶
func (a *TestAction) Length() int64
Length returns the expected length of the action item's file
func (*TestAction) Offset ¶
func (a *TestAction) Offset() int64
Offset returns the current offset of the action item
func (*TestAction) PrimaryPath ¶
func (a *TestAction) PrimaryPath() string
PrimaryPath returns the action item's primary file path
func (*TestAction) SetActualLength ¶
func (a *TestAction) SetActualLength(length int64)
SetActualLength sets the action's actual file length
func (*TestAction) SetHash ¶
func (a *TestAction) SetHash(id []byte)
SetHash sets the action's file id
func (*TestAction) SetURL ¶
func (a *TestAction) SetURL(u string)
SetURL returns the action item's file id
func (*TestAction) SetUUID ¶
func (a *TestAction) SetUUID(u string)
SetUUID returns the action item's file id
func (*TestAction) Update ¶
func (a *TestAction) Update(offset, length, max int64) error
Update sends an action status update
func (*TestAction) WritePath ¶
func (a *TestAction) WritePath() string
WritePath returns the action item's write path (e.g. for restores)