Add repository location parsing code
This commit is contained in:
parent
43cf95e3c6
commit
566a15285a
7 changed files with 370 additions and 0 deletions
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue