aboutsummaryrefslogtreecommitdiff
path: root/internal/nametransform/diriv.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-08-06 21:59:15 +0200
committerJakob Unterwurzacher2017-08-06 21:59:15 +0200
commit5190cc09bbc8afca75986dbb14f09e62eda33b61 (patch)
tree37e5d9fc3febd063e9c09dc44dfbdaefd300a9c3 /internal/nametransform/diriv.go
parent32611ff97afacb6525015ed322645e12bd296380 (diff)
nametransform: move diriv cache into it's own package
Needs some space to grow. renamed: internal/nametransform/diriv_cache.go -> internal/nametransform/dirivcache/dirivcache.go
Diffstat (limited to 'internal/nametransform/diriv.go')
-rw-r--r--internal/nametransform/diriv.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/nametransform/diriv.go b/internal/nametransform/diriv.go
index 5fca1ef..6746f04 100644
--- a/internal/nametransform/diriv.go
+++ b/internal/nametransform/diriv.go
@@ -125,7 +125,7 @@ func (be *NameTransform) EncryptPathDirIV(plainPath string, rootDir string) (cip
// Check if the DirIV is cached. This catches the case of the user iterating
// over files in a directory pretty well.
parentDir := filepath.Dir(plainPath)
- iv, cParentDir := be.DirIVCache.lookup(parentDir)
+ iv, cParentDir := be.DirIVCache.Lookup(parentDir)
if iv != nil {
cBaseName := be.encryptAndHashName(baseName, iv)
return filepath.Join(cParentDir, cBaseName), nil
@@ -138,7 +138,7 @@ func (be *NameTransform) EncryptPathDirIV(plainPath string, rootDir string) (cip
// cached. Then we can skip a few items in the directory walk.
// This catches the case of walking directories recursively.
parentDir2 := filepath.Dir(parentDir)
- iv, cParentDir = be.DirIVCache.lookup(parentDir2)
+ iv, cParentDir = be.DirIVCache.Lookup(parentDir2)
if iv != nil {
parentDirBase := filepath.Base(parentDir)
cBaseName := be.encryptAndHashName(parentDirBase, iv)
@@ -159,6 +159,6 @@ func (be *NameTransform) EncryptPathDirIV(plainPath string, rootDir string) (cip
}
// Cache the final DirIV
cParentDir = filepath.Dir(cipherPath)
- be.DirIVCache.store(parentDir, iv, cParentDir)
+ be.DirIVCache.Store(parentDir, iv, cParentDir)
return cipherPath, nil
}