mirror of
https://github.com/restic/restic.git
synced 2025-12-04 00:21:46 +00:00
Add repository location parsing code
This commit is contained in:
15
backend/local/uri.go
Normal file
15
backend/local/uri.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package local
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ParseConfig parses a local backend config.
|
||||
func ParseConfig(cfg string) (interface{}, error) {
|
||||
if !strings.HasPrefix(cfg, "local:") {
|
||||
return nil, errors.New(`invalid format, prefix "local" not found`)
|
||||
}
|
||||
|
||||
return cfg[6:], nil
|
||||
}
|
||||
Reference in New Issue
Block a user