Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
719d6bad
Commit
719d6bad
authored
Jul 29, 2022
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Make BackupReport.BackupParams a string
parent
f1ac2451
No related branches found
No related tags found
2 merge requests
!510
Release
,
!301
Josh/backup bindings part3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/backup.go
+10
-10
10 additions, 10 deletions
bindings/backup.go
with
10 additions
and
10 deletions
bindings/backup.go
+
10
−
10
View file @
719d6bad
...
@@ -32,7 +32,7 @@ type BackupReport struct {
...
@@ -32,7 +32,7 @@ type BackupReport struct {
BackupIdListJson
[]
byte
BackupIdListJson
[]
byte
// The backup parameters found within the backup file
// The backup parameters found within the backup file
BackupParams
[]
byte
BackupParams
string
}
}
// UpdateBackupFunc contains a function callback that returns new backups.
// UpdateBackupFunc contains a function callback that returns new backups.
...
@@ -57,13 +57,13 @@ type UpdateBackupFunc interface {
...
@@ -57,13 +57,13 @@ type UpdateBackupFunc interface {
//
//
// Returns:
// Returns:
// - []byte - the JSON marshalled bytes of the BackupReport object.
// - []byte - the JSON marshalled bytes of the BackupReport object.
func
NewCmixFromBackup
(
ndfJSON
,
storageDir
string
,
sessionPassword
,
func
NewCmixFromBackup
(
ndfJSON
,
storageDir
,
backupPassphrase
string
,
backupPassphrase
[]
byte
,
backupFileContents
[]
byte
)
([]
byte
,
error
)
{
sessionPassword
,
backupFileContents
[]
byte
)
([]
byte
,
error
)
{
// Restore from backup
// Restore from backup
backupIdList
,
backupParams
Str
,
err
:=
backup
.
NewCmixFromBackup
(
backupIdList
,
backupParams
,
err
:=
backup
.
NewCmixFromBackup
(
ndfJSON
,
storageDir
,
sessionPassword
,
ndfJSON
,
storageDir
,
backupPassphrase
,
sessionPassword
,
backupPassphrase
,
backupFileContents
)
backupFileContents
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -77,7 +77,7 @@ func NewCmixFromBackup(ndfJSON, storageDir string, sessionPassword,
...
@@ -77,7 +77,7 @@ func NewCmixFromBackup(ndfJSON, storageDir string, sessionPassword,
// Construct report
// Construct report
report
:=
BackupReport
{
report
:=
BackupReport
{
BackupIdListJson
:
backupIdListJson
,
BackupIdListJson
:
backupIdListJson
,
BackupParams
:
[]
byte
(
backupParams
Str
)
,
BackupParams
:
backupParams
,
}
}
// Marshal report
// Marshal report
...
@@ -94,9 +94,9 @@ func NewCmixFromBackup(ndfJSON, storageDir string, sessionPassword,
...
@@ -94,9 +94,9 @@ func NewCmixFromBackup(ndfJSON, storageDir string, sessionPassword,
// Params
// Params
// - e2eID - ID of the E2e object in the e2e tracker.
// - e2eID - ID of the E2e object in the e2e tracker.
// - udID - ID of the UserDiscovery object in the ud tracker.
// - udID - ID of the UserDiscovery object in the ud tracker.
// -
password - password used in LoadCmix
.
// -
backupPassPhrase - backup passphrase provided by the user. Used to decrypt backup
.
// - cb - the callback to be called when a backup is triggered.
// - cb - the callback to be called when a backup is triggered.
func
InitializeBackup
(
e2eID
,
udID
int
,
password
string
,
func
InitializeBackup
(
e2eID
,
udID
int
,
backupPassPhrase
string
,
cb
UpdateBackupFunc
)
(
*
Backup
,
error
)
{
cb
UpdateBackupFunc
)
(
*
Backup
,
error
)
{
// Retrieve the user from the tracker
// Retrieve the user from the tracker
user
,
err
:=
e2eTrackerSingleton
.
get
(
e2eID
)
user
,
err
:=
e2eTrackerSingleton
.
get
(
e2eID
)
...
@@ -111,7 +111,7 @@ func InitializeBackup(e2eID, udID int, password string,
...
@@ -111,7 +111,7 @@ func InitializeBackup(e2eID, udID int, password string,
}
}
// Initialize backup
// Initialize backup
b
,
err
:=
backup
.
InitializeBackup
(
password
,
cb
.
UpdateBackup
,
b
,
err
:=
backup
.
InitializeBackup
(
backupPassPhrase
,
cb
.
UpdateBackup
,
user
.
api
.
GetBackupContainer
(),
user
.
api
.
GetE2E
(),
user
.
api
.
GetBackupContainer
(),
user
.
api
.
GetE2E
(),
user
.
api
.
GetStorage
(),
ud
.
api
,
user
.
api
.
GetStorage
(),
ud
.
api
,
user
.
api
.
GetStorage
()
.
GetKV
(),
user
.
api
.
GetRng
())
user
.
api
.
GetStorage
()
.
GetKV
(),
user
.
api
.
GetRng
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment