-
Notifications
You must be signed in to change notification settings - Fork 244
/
response.go
33 lines (27 loc) · 1.18 KB
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package wakusync
import (
"encoding/json"
"github.com/status-im/status-go/multiaccounts/keypairs"
"github.com/status-im/status-go/multiaccounts/settings"
"github.com/status-im/status-go/protocol/protobuf"
)
type WakuBackedUpDataResponse struct {
FetchingDataProgress map[string]protobuf.FetchingBackedUpDataDetails // key represents the data/section backup details refer to
Profile *BackedUpProfile
Setting *settings.SyncSettingField
Keycards []*keypairs.KeyPair
}
func (sfwr *WakuBackedUpDataResponse) MarshalJSON() ([]byte, error) {
responseItem := struct {
FetchingDataProgress map[string]FetchingBackupedDataDetails `json:"fetchingBackedUpDataProgress,omitempty"`
Profile *BackedUpProfile `json:"backedUpProfile,omitempty"`
Setting *settings.SyncSettingField `json:"backedUpSettings,omitempty"`
Keycards []*keypairs.KeyPair `json:"backedUpKeycards,omitempty"`
}{
Profile: sfwr.Profile,
Setting: sfwr.Setting,
Keycards: sfwr.Keycards,
}
responseItem.FetchingDataProgress = sfwr.FetchingBackedUpDataDetails()
return json.Marshal(responseItem)
}