1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-30 00:00:14 +01:00
restic/src/restic/backend/local/config.go
2017-04-02 20:29:00 +02:00

22 lines
443 B
Go

package local
import (
"strings"
"restic/errors"
)
// Config holds all information needed to open a local repository.
type Config struct {
Path string
Layout string `option:"layout"`
}
// 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 Config{Path: cfg[6:]}, nil
}