From 9b54fd7bdb7ee6b30224bd9bc20d63355674d279 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 3 May 2015 17:14:12 +0200 Subject: [PATCH] server: rename LoadJSONEncrypted -> LoadJSONUnpacked --- cmd/restic/cmd_cat.go | 2 +- server/server.go | 2 +- server/server_test.go | 2 +- snapshot.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/restic/cmd_cat.go b/cmd/restic/cmd_cat.go index c49b7d0e2..fb75a8ba3 100644 --- a/cmd/restic/cmd_cat.go +++ b/cmd/restic/cmd_cat.go @@ -78,7 +78,7 @@ func (cmd CmdCat) Execute(args []string) error { case "snapshot": sn := &restic.Snapshot{} - err = s.LoadJSONEncrypted(backend.Snapshot, id, sn) + err = s.LoadJSONUnpacked(backend.Snapshot, id, sn) if err != nil { return err } diff --git a/server/server.go b/server/server.go index c616fbb0d..c6e7fef63 100644 --- a/server/server.go +++ b/server/server.go @@ -143,7 +143,7 @@ func (s *Server) LoadBlob(t pack.BlobType, id backend.ID) ([]byte, error) { // LoadJSONEncrypted decrypts the data and afterwards calls json.Unmarshal on // the item. -func (s *Server) LoadJSONEncrypted(t backend.Type, id backend.ID, item interface{}) error { +func (s *Server) LoadJSONUnpacked(t backend.Type, id backend.ID, item interface{}) error { // load blob from backend rd, err := s.be.Get(t, id.String()) if err != nil { diff --git a/server/server_test.go b/server/server_test.go index 55c22760c..83a41bb08 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -191,7 +191,7 @@ func TestLoadJSONEncrypted(t *testing.T) { var sn2 restic.Snapshot // restore - err = server.LoadJSONEncrypted(backend.Snapshot, id, &sn2) + err = server.LoadJSONUnpacked(backend.Snapshot, id, &sn2) OK(t, err) Equals(t, sn.Hostname, sn2.Hostname) diff --git a/snapshot.go b/snapshot.go index 6263d1a55..a928e27ad 100644 --- a/snapshot.go +++ b/snapshot.go @@ -52,7 +52,7 @@ func NewSnapshot(paths []string) (*Snapshot, error) { func LoadSnapshot(s *server.Server, id backend.ID) (*Snapshot, error) { sn := &Snapshot{id: id} - err := s.LoadJSONEncrypted(backend.Snapshot, id, sn) + err := s.LoadJSONUnpacked(backend.Snapshot, id, sn) if err != nil { return nil, err }