restic/src/restic/backend/local/config.go

17 lines
290 B
Go
Raw Normal View History

2015-12-28 15:51:24 +01:00
package local
import (
"strings"
2016-09-01 22:17:37 +02:00
"restic/errors"
2015-12-28 15:51:24 +01:00
)
// 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
}