forked from TrueCloudLab/restic
backend/layout: Add Basedir()
This commit is contained in:
parent
e2af5890f3
commit
320c22f1f5
4 changed files with 16 additions and 0 deletions
|
@ -15,6 +15,7 @@ import (
|
||||||
type Layout interface {
|
type Layout interface {
|
||||||
Filename(restic.Handle) string
|
Filename(restic.Handle) string
|
||||||
Dirname(restic.Handle) string
|
Dirname(restic.Handle) string
|
||||||
|
Basedir(restic.FileType) string
|
||||||
Paths() []string
|
Paths() []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,3 +34,8 @@ func (l *CloudLayout) Paths() (dirs []string) {
|
||||||
}
|
}
|
||||||
return dirs
|
return dirs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basedir returns the base dir name for files of type t.
|
||||||
|
func (l *CloudLayout) Basedir(t restic.FileType) string {
|
||||||
|
return l.Join(l.Path, cloudLayoutPaths[t])
|
||||||
|
}
|
||||||
|
|
|
@ -47,3 +47,8 @@ func (l *DefaultLayout) Paths() (dirs []string) {
|
||||||
}
|
}
|
||||||
return dirs
|
return dirs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basedir returns the base dir name for type t.
|
||||||
|
func (l *DefaultLayout) Basedir(t restic.FileType) string {
|
||||||
|
return l.Join(l.Path, defaultLayoutPaths[t])
|
||||||
|
}
|
||||||
|
|
|
@ -40,3 +40,8 @@ func (l *S3Layout) Paths() (dirs []string) {
|
||||||
}
|
}
|
||||||
return dirs
|
return dirs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basedir returns the base dir name for type t.
|
||||||
|
func (l *S3Layout) Basedir(t restic.FileType) string {
|
||||||
|
return l.Join(l.Path, s3LayoutPaths[t])
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue