options: Register local and sftp backends

This commit is contained in:
Alexander Neumann 2017-04-13 23:55:32 +02:00
parent b7671dafc8
commit 859ee23d2e
2 changed files with 13 additions and 3 deletions

View File

@ -4,12 +4,17 @@ import (
"strings"
"restic/errors"
"restic/options"
)
// Config holds all information needed to open a local repository.
type Config struct {
Path string
Layout string `option:"layout"`
Layout string `option:"layout" help:"use this backend directory layout (default: auto-detect)"`
}
func init() {
options.Register("local", Config{})
}
// ParseConfig parses a local backend config.

View File

@ -6,13 +6,18 @@ import (
"strings"
"restic/errors"
"restic/options"
)
// Config collects all information required to connect to an sftp server.
type Config struct {
User, Host, Path string
Layout string `option:"layout"`
Command string `option:"command"`
Layout string `option:"layout" help:"use this backend directory layout (default: auto-detect)"`
Command string `option:"command" help:"specify command to create sftp connection"`
}
func init() {
options.Register("sftp", Config{})
}
// ParseConfig parses the string s and extracts the sftp config. The