mirror of
https://github.com/restic/restic.git
synced 2025-12-10 07:21:55 +00:00
Rename 'Repository' -> Repo
This commit is contained in:
@@ -59,7 +59,7 @@ func parseTime(str string) (time.Time, error) {
|
||||
return time.Time{}, fmt.Errorf("unable to parse time: %q", str)
|
||||
}
|
||||
|
||||
func (c CmdFind) findInTree(repo *repo.Repository, id backend.ID, path string) ([]findResult, error) {
|
||||
func (c CmdFind) findInTree(repo *repo.Repo, id backend.ID, path string) ([]findResult, error) {
|
||||
debug.Log("restic.find", "checking tree %v\n", id)
|
||||
tree, err := restic.LoadTree(repo, id)
|
||||
if err != nil {
|
||||
@@ -105,7 +105,7 @@ func (c CmdFind) findInTree(repo *repo.Repository, id backend.ID, path string) (
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (c CmdFind) findInSnapshot(repo *repo.Repository, name string) error {
|
||||
func (c CmdFind) findInSnapshot(repo *repo.Repo, name string) error {
|
||||
debug.Log("restic.find", "searching in snapshot %s\n for entries within [%s %s]", name, c.oldest, c.newest)
|
||||
|
||||
id, err := backend.ParseID(name)
|
||||
|
||||
@@ -34,7 +34,7 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func fsckFile(opts CmdFsck, repo *repo.Repository, IDs []backend.ID) (uint64, error) {
|
||||
func fsckFile(opts CmdFsck, repo *repo.Repo, IDs []backend.ID) (uint64, error) {
|
||||
debug.Log("restic.fsckFile", "checking file %v", IDs)
|
||||
var bytes uint64
|
||||
|
||||
@@ -77,7 +77,7 @@ func fsckFile(opts CmdFsck, repo *repo.Repository, IDs []backend.ID) (uint64, er
|
||||
return bytes, nil
|
||||
}
|
||||
|
||||
func fsckTree(opts CmdFsck, repo *repo.Repository, id backend.ID) error {
|
||||
func fsckTree(opts CmdFsck, repo *repo.Repo, id backend.ID) error {
|
||||
debug.Log("restic.fsckTree", "checking tree %v", id.Str())
|
||||
|
||||
tree, err := restic.LoadTree(repo, id)
|
||||
@@ -157,7 +157,7 @@ func fsckTree(opts CmdFsck, repo *repo.Repository, id backend.ID) error {
|
||||
return firstErr
|
||||
}
|
||||
|
||||
func fsckSnapshot(opts CmdFsck, repo *repo.Repository, id backend.ID) error {
|
||||
func fsckSnapshot(opts CmdFsck, repo *repo.Repo, id backend.ID) error {
|
||||
debug.Log("restic.fsck", "checking snapshot %v\n", id)
|
||||
|
||||
sn, err := restic.LoadSnapshot(repo, id)
|
||||
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func listKeys(s *repo.Repository) error {
|
||||
func listKeys(s *repo.Repo) error {
|
||||
tab := NewTable()
|
||||
tab.Header = fmt.Sprintf(" %-10s %-10s %-10s %s", "ID", "User", "Host", "Created")
|
||||
tab.RowFormat = "%s%-10s %-10s %-10s %s"
|
||||
@@ -56,7 +56,7 @@ func listKeys(s *repo.Repository) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func addKey(s *repo.Repository) error {
|
||||
func addKey(s *repo.Repo) error {
|
||||
pw := readPassword("RESTIC_NEWPASSWORD", "enter password for new key: ")
|
||||
pw2 := readPassword("RESTIC_NEWPASSWORD", "enter password again: ")
|
||||
|
||||
@@ -74,7 +74,7 @@ func addKey(s *repo.Repository) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func deleteKey(repo *repo.Repository, name string) error {
|
||||
func deleteKey(repo *repo.Repo, name string) error {
|
||||
if name == repo.KeyName() {
|
||||
return errors.New("refusing to remove key currently used to access repository")
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func deleteKey(repo *repo.Repository, name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func changePassword(s *repo.Repository) error {
|
||||
func changePassword(s *repo.Repo) error {
|
||||
pw := readPassword("RESTIC_NEWPASSWORD", "enter password for new key: ")
|
||||
pw2 := readPassword("RESTIC_NEWPASSWORD", "enter password again: ")
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ func printNode(prefix string, n *restic.Node) string {
|
||||
}
|
||||
}
|
||||
|
||||
func printTree(prefix string, repo *repo.Repository, id backend.ID) error {
|
||||
func printTree(prefix string, repo *repo.Repo, id backend.ID) error {
|
||||
tree, err := restic.LoadTree(repo, id)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -133,7 +133,7 @@ func create(u string) (backend.Backend, error) {
|
||||
return sftp.Create(url.Path[1:], "ssh", args...)
|
||||
}
|
||||
|
||||
func OpenRepo() (*repo.Repository, error) {
|
||||
func OpenRepo() (*repo.Repo, error) {
|
||||
if opts.Repo == "" {
|
||||
return nil, errors.New("Please specify repository location (-r)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user