mirror of
https://github.com/octoleo/restic.git
synced 2025-01-26 16:48:29 +00:00
options: Register local and sftp backends
This commit is contained in:
parent
b7671dafc8
commit
859ee23d2e
@ -4,12 +4,17 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"restic/errors"
|
"restic/errors"
|
||||||
|
"restic/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config holds all information needed to open a local repository.
|
// Config holds all information needed to open a local repository.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Path string
|
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.
|
// ParseConfig parses a local backend config.
|
||||||
|
@ -6,13 +6,18 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"restic/errors"
|
"restic/errors"
|
||||||
|
"restic/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config collects all information required to connect to an sftp server.
|
// Config collects all information required to connect to an sftp server.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
User, Host, Path string
|
User, Host, Path string
|
||||||
Layout string `option:"layout"`
|
Layout string `option:"layout" help:"use this backend directory layout (default: auto-detect)"`
|
||||||
Command string `option:"command"`
|
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
|
// ParseConfig parses the string s and extracts the sftp config. The
|
||||||
|
Loading…
x
Reference in New Issue
Block a user