-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64ff7b8
commit 12dae9d
Showing
9 changed files
with
886 additions
and
6,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package worker | ||
|
||
import ( | ||
"encoding/hex" | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/dgraph-io/dgraph/v24/protos/pb" | ||
"google.golang.org/protobuf/proto" | ||
) | ||
|
||
func TestRestore(t *testing.T) { | ||
hexVal := "0802120b417574686f722e6e616d652a210ba7095692826af0b5dbe98d882e509736f7f205006def55d6cf773bae4b7a9b23" | ||
|
||
data, err := hex.DecodeString(hexVal) | ||
if err != nil { | ||
t.Fatalf("Error while decoding hex string: %v", err) | ||
} | ||
|
||
fmt.Println([]rune(string(data))) | ||
|
||
for _, r := range string(data) { | ||
fmt.Println("--------->", r, []byte(string(r))) | ||
} | ||
|
||
backupKey := &pb.BackupKey{} | ||
if err := proto.Unmarshal(data, backupKey); err != nil { | ||
panic("error") | ||
|
||
// return nil, 0, errors.Wrapf(err, "while reading backup key %s", hex.Dump(key)) | ||
} | ||
fmt.Println(string(data)) | ||
|
||
fmt.Println(fromBackupKey(data)) | ||
t.FailNow() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters