mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
backend/layout: Add Basedir()
This commit is contained in:
parent
e2af5890f3
commit
320c22f1f5
@ -15,6 +15,7 @@ import (
|
||||
type Layout interface {
|
||||
Filename(restic.Handle) string
|
||||
Dirname(restic.Handle) string
|
||||
Basedir(restic.FileType) string
|
||||
Paths() []string
|
||||
}
|
||||
|
||||
|
@ -34,3 +34,8 @@ func (l *CloudLayout) Paths() (dirs []string) {
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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 New Issue
Block a user