mirror of
https://github.com/octoleo/restic.git
synced 2025-01-11 02:08:44 +00:00
options: Register local and sftp backends
This commit is contained in:
parent
b7671dafc8
commit
859ee23d2e
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user