forked from TrueCloudLab/restic
server: rename LoadJSONEncrypted -> LoadJSONUnpacked
This commit is contained in:
parent
2fb1783885
commit
9b54fd7bdb
4 changed files with 4 additions and 4 deletions
|
@ -78,7 +78,7 @@ func (cmd CmdCat) Execute(args []string) error {
|
||||||
|
|
||||||
case "snapshot":
|
case "snapshot":
|
||||||
sn := &restic.Snapshot{}
|
sn := &restic.Snapshot{}
|
||||||
err = s.LoadJSONEncrypted(backend.Snapshot, id, sn)
|
err = s.LoadJSONUnpacked(backend.Snapshot, id, sn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
// LoadJSONEncrypted decrypts the data and afterwards calls json.Unmarshal on
|
||||||
// the item.
|
// 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
|
// load blob from backend
|
||||||
rd, err := s.be.Get(t, id.String())
|
rd, err := s.be.Get(t, id.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -191,7 +191,7 @@ func TestLoadJSONEncrypted(t *testing.T) {
|
||||||
var sn2 restic.Snapshot
|
var sn2 restic.Snapshot
|
||||||
|
|
||||||
// restore
|
// restore
|
||||||
err = server.LoadJSONEncrypted(backend.Snapshot, id, &sn2)
|
err = server.LoadJSONUnpacked(backend.Snapshot, id, &sn2)
|
||||||
OK(t, err)
|
OK(t, err)
|
||||||
|
|
||||||
Equals(t, sn.Hostname, sn2.Hostname)
|
Equals(t, sn.Hostname, sn2.Hostname)
|
||||||
|
|
|
@ -52,7 +52,7 @@ func NewSnapshot(paths []string) (*Snapshot, error) {
|
||||||
|
|
||||||
func LoadSnapshot(s *server.Server, id backend.ID) (*Snapshot, error) {
|
func LoadSnapshot(s *server.Server, id backend.ID) (*Snapshot, error) {
|
||||||
sn := &Snapshot{id: id}
|
sn := &Snapshot{id: id}
|
||||||
err := s.LoadJSONEncrypted(backend.Snapshot, id, sn)
|
err := s.LoadJSONUnpacked(backend.Snapshot, id, sn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue