Add type 'Index' to backend

This commit is contained in:
Alexander Neumann 2015-04-26 15:48:35 +02:00
parent 8f3b91ba32
commit 87ce38b13a
5 changed files with 15 additions and 1 deletions

View file

@ -79,6 +79,7 @@ func Open(dir string, program string, args ...string) (*SFTP, error) {
filepath.Join(dir, backend.Paths.Data),
filepath.Join(dir, backend.Paths.Snapshots),
filepath.Join(dir, backend.Paths.Trees),
filepath.Join(dir, backend.Paths.Index),
filepath.Join(dir, backend.Paths.Locks),
filepath.Join(dir, backend.Paths.Keys),
filepath.Join(dir, backend.Paths.Version),
@ -153,6 +154,7 @@ func Create(dir string, program string, args ...string) (*SFTP, error) {
filepath.Join(dir, backend.Paths.Data),
filepath.Join(dir, backend.Paths.Snapshots),
filepath.Join(dir, backend.Paths.Trees),
filepath.Join(dir, backend.Paths.Index),
filepath.Join(dir, backend.Paths.Locks),
filepath.Join(dir, backend.Paths.Keys),
filepath.Join(dir, backend.Paths.Temp),
@ -408,6 +410,8 @@ func (r *SFTP) dirname(t backend.Type, name string) string {
if len(name) > 2 {
n = filepath.Join(n, name[:2])
}
case backend.Index:
n = backend.Paths.Index
case backend.Lock:
n = backend.Paths.Locks
case backend.Key: