Documentation ¶
Index ¶
- func CopyWithProgress(dst io.Writer, src io.Reader, length int64, action dmplugin.Action) (int64, error)
- type ArchiveConfig
- type ArchiveSet
- type ChecksumConfig
- type CompressionOption
- type Mover
- func (m *Mover) Archive(action dmplugin.Action) error
- func (m *Mover) ChecksumConfig() *ChecksumConfig
- func (m *Mover) ChecksumEnabled() bool
- func (m *Mover) ChecksumWriter(dst io.Writer) (cw checksum.Writer)
- func (m *Mover) Destination(id string) string
- func (m *Mover) Remove(action dmplugin.Action) error
- func (m *Mover) Restore(action dmplugin.Action) error
- func (m *Mover) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArchiveConfig ¶
type ArchiveConfig struct { Name string `hcl:",key"` ID int `hcl:"id"` Root string `hcl:"root"` Compression string `hcl:"compression"` Checksums *ChecksumConfig `hcl:"checksums"` }
ArchiveConfig is configuration for one mover.
func (*ArchiveConfig) CheckValid ¶
func (a *ArchiveConfig) CheckValid() error
CheckValid determines if the archive configuration is a valid one.
func (*ArchiveConfig) CompressionOption ¶
func (a *ArchiveConfig) CompressionOption() CompressionOption
CompressionOption parses Compression config parameter
func (*ArchiveConfig) Merge ¶
func (a *ArchiveConfig) Merge(other *ArchiveConfig) *ArchiveConfig
Merge the two configs and return a copy. Does not return nil, even if both a and other are nil.
func (*ArchiveConfig) String ¶
func (a *ArchiveConfig) String() string
type ArchiveSet ¶
type ArchiveSet []*ArchiveConfig
ArchiveSet is a list of mover configs.
func (ArchiveSet) Merge ¶
func (as ArchiveSet) Merge(other ArchiveSet) ArchiveSet
Merge the two sets. Actually just returns the other one if set otherwise it returns the original set. TODO: actually merge the sets here
type ChecksumConfig ¶
type ChecksumConfig struct { Disabled bool `hcl:"disabled"` DisableCompareOnRestore bool `hcl:"disable_compare_on_restore"` }
ChecksumConfig defines the configured behavior for file checksumming in the POSIX data mover
var ( // DefaultChecksums are enabled DefaultChecksums ChecksumConfig )
func (*ChecksumConfig) Merge ¶
func (c *ChecksumConfig) Merge(other *ChecksumConfig) *ChecksumConfig
Merge the two configurations. Returns a copy of other if it is not nil, otherwise retuns a copy of c.
type CompressionOption ¶
type CompressionOption int
CompressionOption value determines if data compression is enabled.
const ( // CompressOff disables data compression CompressOff CompressionOption = iota // CompressOn enables data compression CompressOn // CompressAuto enables compression when a compressible file is detection CompressAuto )
type Mover ¶
type Mover struct { Name string ArchiveDir string Compression CompressionOption Checksums ChecksumConfig }
Mover is a POSIX data mover
func (*Mover) ChecksumConfig ¶
func (m *Mover) ChecksumConfig() *ChecksumConfig
ChecksumConfig returns the mover's checksum configuration Returns a pointer so the caller can modify the config.
func (*Mover) ChecksumEnabled ¶
ChecksumEnabled returns true if user has enabled checksum calculation.
func (*Mover) ChecksumWriter ¶
ChecksumWriter returns an instance of its namesake.
func (*Mover) Destination ¶
Destination returns the path to archived file. Exported for testing.