Add repository location parsing code

This commit is contained in:
Alexander Neumann 2015-12-28 15:51:24 +01:00
parent 43cf95e3c6
commit 566a15285a
7 changed files with 370 additions and 0 deletions

15
backend/local/uri.go Normal file
View 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
}