mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
38 lines
793 B
Go
38 lines
793 B
Go
package config
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/restic/restic/backend"
|
|
)
|
|
|
|
var root string
|
|
|
|
func Init(path string) {
|
|
root = path
|
|
}
|
|
|
|
func ConfigPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Config))
|
|
}
|
|
|
|
func DataPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Data))
|
|
}
|
|
|
|
func SnapshotPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Snapshot))
|
|
}
|
|
|
|
func IndexPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Index))
|
|
}
|
|
|
|
func LockPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Lock))
|
|
}
|
|
|
|
func KeyPath(repository string) string {
|
|
return filepath.Join(root, repository, string(backend.Key))
|
|
}
|