Skip to content
Snippets Groups Projects
Commit 8737a80c authored by Jake Taylor's avatar Jake Taylor
Browse files

fix single-use json documentation

parent e30a6084
No related branches found
No related tags found
1 merge request!510Release
...@@ -62,7 +62,7 @@ func TransmitSingleUse(e2eID int, recipient []byte, tag string, payload, ...@@ -62,7 +62,7 @@ func TransmitSingleUse(e2eID int, recipient []byte, tag string, payload,
} }
sr := SingleUseSendReport{ sr := SingleUseSendReport{
EphID: eid.EphId.Int64(), EphID: eid.EphId.Int64(),
ReceptionID: eid.Source.Marshal(), ReceptionID: eid.Source,
RoundsList: makeRoundsList(rids...), RoundsList: makeRoundsList(rids...),
} }
return json.Marshal(sr) return json.Marshal(sr)
...@@ -85,11 +85,11 @@ func Listen(e2eID int, tag string, cb SingleUseCallback) (Stopper, error) { ...@@ -85,11 +85,11 @@ func Listen(e2eID int, tag string, cb SingleUseCallback) (Stopper, error) {
} }
suListener := singleUseListener{scb: cb} suListener := singleUseListener{scb: cb}
dhpk, err := e2eCl.api.GetReceptionIdentity().GetDHKeyPrivate() dhPk, err := e2eCl.api.GetReceptionIdentity().GetDHKeyPrivate()
if err != nil { if err != nil {
return nil, err return nil, err
} }
l := single.Listen(tag, e2eCl.api.GetReceptionIdentity().ID, dhpk, l := single.Listen(tag, e2eCl.api.GetReceptionIdentity().ID, dhPk,
e2eCl.api.GetCmix(), e2eCl.api.GetStorage().GetE2EGroup(), suListener) e2eCl.api.GetCmix(), e2eCl.api.GetStorage().GetE2EGroup(), suListener)
return &stopper{l: l}, nil return &stopper{l: l}, nil
} }
...@@ -102,12 +102,12 @@ func Listen(e2eID int, tag string, cb SingleUseCallback) (Stopper, error) { ...@@ -102,12 +102,12 @@ func Listen(e2eID int, tag string, cb SingleUseCallback) (Stopper, error) {
// JSON example: // JSON example:
// { // {
// "Rounds":[1,5,9], // "Rounds":[1,5,9],
// "EphID":{"EphId":[0,0,0,0,0,0,3,89], // "EphID":1655533,
// "Source":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} // "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}
// } // }
type SingleUseSendReport struct { type SingleUseSendReport struct {
RoundsList RoundsList
ReceptionID []byte ReceptionID *id.ID
EphID int64 EphID int64
} }
...@@ -119,14 +119,14 @@ type SingleUseSendReport struct { ...@@ -119,14 +119,14 @@ type SingleUseSendReport struct {
// { // {
// "Rounds":[1,5,9], // "Rounds":[1,5,9],
// "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", // "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==",
// "ReceptionID":{"EphId":[0,0,0,0,0,0,3,89], // "EphID":1655533,
// "Source":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}, // "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"},
// "Err":null // "Err":"",
// } // }
type SingleUseResponseReport struct { type SingleUseResponseReport struct {
RoundsList RoundsList
Payload []byte Payload []byte
ReceptionID []byte ReceptionID *id.ID
EphID int64 EphID int64
Err error Err error
} }
...@@ -139,15 +139,15 @@ type SingleUseResponseReport struct { ...@@ -139,15 +139,15 @@ type SingleUseResponseReport struct {
// "Rounds":[1,5,9], // "Rounds":[1,5,9],
// "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", // "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==",
// "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", // "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD",
// "EphID":{"EphId":[0,0,0,0,0,0,3,89], // "EphID":1655533,
// "Source":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} // "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}
// } // }
type SingleUseCallbackReport struct { type SingleUseCallbackReport struct {
RoundsList RoundsList
Payload []byte Payload []byte
Partner *id.ID Partner *id.ID
EphID int64 EphID int64
ReceptionID []byte ReceptionID *id.ID
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -209,7 +209,7 @@ func (sl singleUseListener) Callback( ...@@ -209,7 +209,7 @@ func (sl singleUseListener) Callback(
RoundsList: makeRoundsList(rids...), RoundsList: makeRoundsList(rids...),
Partner: req.GetPartner(), Partner: req.GetPartner(),
EphID: eid.EphId.Int64(), EphID: eid.EphId.Int64(),
ReceptionID: eid.Source.Marshal(), ReceptionID: eid.Source,
} }
sl.scb.Callback(json.Marshal(scr)) sl.scb.Callback(json.Marshal(scr))
...@@ -245,7 +245,7 @@ func (sr singleUseResponse) Callback(payload []byte, ...@@ -245,7 +245,7 @@ func (sr singleUseResponse) Callback(payload []byte,
} }
sendReport := SingleUseResponseReport{ sendReport := SingleUseResponseReport{
RoundsList: makeRoundsList(rids...), RoundsList: makeRoundsList(rids...),
ReceptionID: receptionID.Source.Marshal(), ReceptionID: receptionID.Source,
EphID: receptionID.EphId.Int64(), EphID: receptionID.EphId.Int64(),
Payload: payload, Payload: payload,
Err: err, Err: err,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment