mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
spelling
This commit is contained in:
@@ -981,12 +981,12 @@ type fileEncoder struct {
|
|||||||
buffer *bytes.Buffer
|
buffer *bytes.Buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read reads data from the embeded buffer
|
// Read reads data from the embedded buffer
|
||||||
func (encoder fileEncoder) Read(data []byte) (n int, err error) {
|
func (encoder fileEncoder) Read(data []byte) (n int, err error) {
|
||||||
return encoder.buffer.Read(data)
|
return encoder.buffer.Read(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextFile switchs to the next file and generates its json description in the buffer. It also takes care of
|
// NextFile switches to the next file and generates its json description in the buffer. It also takes care of
|
||||||
// the ending ']' and the commas between files.
|
// the ending ']' and the commas between files.
|
||||||
func (encoder *fileEncoder) NextFile() (io.Reader, bool) {
|
func (encoder *fileEncoder) NextFile() (io.Reader, bool) {
|
||||||
if encoder.currentIndex == len(encoder.files) {
|
if encoder.currentIndex == len(encoder.files) {
|
||||||
@@ -1126,7 +1126,7 @@ func (manager *BackupManager) UploadSnapshot(chunkMaker *ChunkMaker, uploader *C
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Restore downloads a file from the storage. If 'inPlace' is false, the download file is saved first to a temporary
|
// Restore downloads a file from the storage. If 'inPlace' is false, the download file is saved first to a temporary
|
||||||
// file under the .duplicacy directory and then replaces the existing one. Otherwise, the exising file will be
|
// file under the .duplicacy directory and then replaces the existing one. Otherwise, the existing file will be
|
||||||
// overwritten directly.
|
// overwritten directly.
|
||||||
func (manager *BackupManager) RestoreFile(chunkDownloader *ChunkDownloader, chunkMaker *ChunkMaker, entry *Entry, top string, inPlace bool, overwrite bool,
|
func (manager *BackupManager) RestoreFile(chunkDownloader *ChunkDownloader, chunkMaker *ChunkMaker, entry *Entry, top string, inPlace bool, overwrite bool,
|
||||||
showStatistics bool, totalFileSize int64, downloadedFileSize int64, startTime int64) bool {
|
showStatistics bool, totalFileSize int64, downloadedFileSize int64, startTime int64) bool {
|
||||||
@@ -1528,7 +1528,7 @@ func (manager *BackupManager) CopySnapshots(otherManager *BackupManager, snapsho
|
|||||||
revisionsToBeCopied []int, threads int) bool {
|
revisionsToBeCopied []int, threads int) bool {
|
||||||
|
|
||||||
if !manager.config.IsCompatiableWith(otherManager.config) {
|
if !manager.config.IsCompatiableWith(otherManager.config) {
|
||||||
LOG_ERROR("CONFIG_INCOMPATIABLE", "Two storages are not compatiable for the copy operation")
|
LOG_ERROR("CONFIG_INCOMPATIBLE", "Two storages are not compatible for the copy operation")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ func (chunk *Chunk) Encrypt(encryptionKey []byte, derivationKey string) (err err
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is to ensure compability with Vertical Backup, which still uses HMAC-SHA256 (instead of HMAC-BLAKE2) to
|
// This is to ensure compatibility with Vertical Backup, which still uses HMAC-SHA256 (instead of HMAC-BLAKE2) to
|
||||||
// derive the key used to encrypt/decrypt files and chunks.
|
// derive the key used to encrypt/decrypt files and chunks.
|
||||||
|
|
||||||
var DecryptWithHMACSHA256 = false
|
var DecryptWithHMACSHA256 = false
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func TestChunk(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if bytes.Compare(plainData, decryptedData) != 0 {
|
if bytes.Compare(plainData, decryptedData) != 0 {
|
||||||
t.Logf("orginal length: %d, decrypted length: %d", len(plainData), len(decryptedData))
|
t.Logf("Original length: %d, decrypted length: %d", len(plainData), len(decryptedData))
|
||||||
t.Errorf("Original data:\n%x\nDecrypted data:\n%x\n", plainData, decryptedData)
|
t.Errorf("Original data:\n%x\nDecrypted data:\n%x\n", plainData, decryptedData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const (
|
|||||||
ChunkOperationResurrect = 3
|
ChunkOperationResurrect = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChunkOperatorTask is used to pass paramaters for different kinds of chunk operations.
|
// ChunkOperatorTask is used to pass parameters for different kinds of chunk operations.
|
||||||
type ChunkOperatorTask struct {
|
type ChunkOperatorTask struct {
|
||||||
operation int // The type of operation
|
operation int // The type of operation
|
||||||
chunkID string // The chunk id
|
chunkID string // The chunk id
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func CreateFileReader(top string, files []*Entry) *FileReader {
|
|||||||
return reader
|
return reader
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextFile switchs to the next file in the file reader.
|
// NextFile switches to the next file in the file reader.
|
||||||
func (reader *FileReader) NextFile() bool {
|
func (reader *FileReader) NextFile() bool {
|
||||||
|
|
||||||
if reader.CurrentFile != nil {
|
if reader.CurrentFile != nil {
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ func (manager *SnapshotManager) CleanSnapshotCache(latestSnapshot *Snapshot, all
|
|||||||
|
|
||||||
if allSnapshots == nil {
|
if allSnapshots == nil {
|
||||||
// If the 'fossils' directory exists then don't clean the cache as all snapshots will be needed later
|
// If the 'fossils' directory exists then don't clean the cache as all snapshots will be needed later
|
||||||
// during the fossil collection phase. The deletion procedure creates this direcotry.
|
// during the fossil collection phase. The deletion procedure creates this directory.
|
||||||
// We only check this condition when allSnapshots is nil because
|
// We only check this condition when allSnapshots is nil because
|
||||||
// in thise case it is the deletion procedure that is trying to clean the snapshot cache.
|
// in thise case it is the deletion procedure that is trying to clean the snapshot cache.
|
||||||
exist, _, _, err := manager.snapshotCache.GetFileInfo(0, "fossils")
|
exist, _, _, err := manager.snapshotCache.GetFileInfo(0, "fossils")
|
||||||
@@ -1154,7 +1154,7 @@ func (manager *SnapshotManager) VerifySnapshot(snapshot *Snapshot) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RetrieveFile retrieve the file in the specifed snapshot.
|
// RetrieveFile retrieves the file in the specified snapshot.
|
||||||
func (manager *SnapshotManager) RetrieveFile(snapshot *Snapshot, file *Entry, output func([]byte)) bool {
|
func (manager *SnapshotManager) RetrieveFile(snapshot *Snapshot, file *Entry, output func([]byte)) bool {
|
||||||
|
|
||||||
if file.Size == 0 {
|
if file.Size == 0 {
|
||||||
@@ -2247,7 +2247,7 @@ func (manager *SnapshotManager) pruneSnapshotsExhaustive(referencedFossils map[s
|
|||||||
chunk := strings.Replace(file, "/", "", -1)
|
chunk := strings.Replace(file, "/", "", -1)
|
||||||
|
|
||||||
if !chunkRegex.MatchString(chunk) {
|
if !chunkRegex.MatchString(chunk) {
|
||||||
LOG_WARN("CHUNK_UNKONWN_FILE", "File %s is not a chunk", file)
|
LOG_WARN("CHUNK_UNKNOWN_FILE", "File %s is not a chunk", file)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ func (storage *StorageBase) SetRateLimits(downloadRateLimit int, uploadRateLimit
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetDefaultNestingLevels sets the default read and write levels. This is usually called by
|
// SetDefaultNestingLevels sets the default read and write levels. This is usually called by
|
||||||
// derived storages to set the levels with old values so that storages initialied by ealier versions
|
// derived storages to set the levels with old values so that storages initialized by earlier versions
|
||||||
// will continue to work.
|
// will continue to work.
|
||||||
func (storage *StorageBase) SetDefaultNestingLevels(readLevels []int, writeLevel int) {
|
func (storage *StorageBase) SetDefaultNestingLevels(readLevels []int, writeLevel int) {
|
||||||
storage.readLevels = readLevels
|
storage.readLevels = readLevels
|
||||||
|
|||||||
Reference in New Issue
Block a user