Files
rest-server/config/config.go
2015-08-11 14:14:07 +02:00

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))
}