Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Cronin authored and robert-cronin committed Oct 15, 2020
1 parent 0e51e02 commit a39e7b1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 44 deletions.
48 changes: 24 additions & 24 deletions proto/compiled/Peer_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as jspb from "google-protobuf";

export class PeerMessage extends jspb.Message {
export class PeerMessage extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerMessage;

Expand Down Expand Up @@ -35,7 +35,7 @@ export namespace PeerMessage {
}
}

export class PingPeerMessage extends jspb.Message {
export class PingPeerMessage extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PingPeerMessage;

Expand Down Expand Up @@ -67,7 +67,7 @@ export namespace PingPeerMessage {
}
}

export class PeerInfoMessage extends jspb.Message {
export class PeerInfoMessage extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerInfoMessage;

Expand Down Expand Up @@ -96,7 +96,7 @@ export namespace PeerInfoMessage {
}
}

export class PeerInfoListMessage extends jspb.Message {
export class PeerInfoListMessage extends jspb.Message {
clearPeerInfoListList(): void;
getPeerInfoListList(): Array<PeerInfoMessage>;
setPeerInfoListList(value: Array<PeerInfoMessage>): PeerInfoListMessage;
Expand All @@ -119,7 +119,7 @@ export namespace PeerInfoListMessage {
}
}

export class ErrorMessage extends jspb.Message {
export class ErrorMessage extends jspb.Message {
getError(): string;
setError(value: string): ErrorMessage;

Expand All @@ -140,7 +140,7 @@ export namespace ErrorMessage {
}
}

export class NatMessage extends jspb.Message {
export class NatMessage extends jspb.Message {
getType(): NatMessageType;
setType(value: NatMessageType): NatMessage;

Expand Down Expand Up @@ -171,7 +171,7 @@ export namespace NatMessage {
}
}

export class RelayConnectionRequest extends jspb.Message {
export class RelayConnectionRequest extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): RelayConnectionRequest;

Expand All @@ -192,7 +192,7 @@ export namespace RelayConnectionRequest {
}
}

export class RelayConnectionResponse extends jspb.Message {
export class RelayConnectionResponse extends jspb.Message {
getServerAddress(): string;
setServerAddress(value: string): RelayConnectionResponse;

Expand All @@ -213,7 +213,7 @@ export namespace RelayConnectionResponse {
}
}

export class PeerConnectionRequest extends jspb.Message {
export class PeerConnectionRequest extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerConnectionRequest;

Expand All @@ -234,7 +234,7 @@ export namespace PeerConnectionRequest {
}
}

export class PeerConnectionResponse extends jspb.Message {
export class PeerConnectionResponse extends jspb.Message {
getPeerAddress(): string;
setPeerAddress(value: string): PeerConnectionResponse;

Expand All @@ -255,7 +255,7 @@ export namespace PeerConnectionResponse {
}
}

export class UDPAddressResponse extends jspb.Message {
export class UDPAddressResponse extends jspb.Message {
getAddress(): string;
setAddress(value: string): UDPAddressResponse;

Expand All @@ -276,7 +276,7 @@ export namespace UDPAddressResponse {
}
}

export class HolePunchRegisterRequest extends jspb.Message {
export class HolePunchRegisterRequest extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): HolePunchRegisterRequest;

Expand All @@ -297,7 +297,7 @@ export namespace HolePunchRegisterRequest {
}
}

export class HolePunchRegisterResponse extends jspb.Message {
export class HolePunchRegisterResponse extends jspb.Message {
getConnectedAddress(): string;
setConnectedAddress(value: string): HolePunchRegisterResponse;

Expand All @@ -318,7 +318,7 @@ export namespace HolePunchRegisterResponse {
}
}

export class PeerUdpAddressRequest extends jspb.Message {
export class PeerUdpAddressRequest extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerUdpAddressRequest;

Expand All @@ -339,7 +339,7 @@ export namespace PeerUdpAddressRequest {
}
}

export class PeerUdpAddressResponse extends jspb.Message {
export class PeerUdpAddressResponse extends jspb.Message {
getAddress(): string;
setAddress(value: string): PeerUdpAddressResponse;

Expand All @@ -360,7 +360,7 @@ export namespace PeerUdpAddressResponse {
}
}

export class CAMessage extends jspb.Message {
export class CAMessage extends jspb.Message {
getType(): CAMessageType;
setType(value: CAMessageType): CAMessage;

Expand Down Expand Up @@ -391,7 +391,7 @@ export namespace CAMessage {
}
}

export class PeerDHTMessage extends jspb.Message {
export class PeerDHTMessage extends jspb.Message {
getType(): PeerDHTMessageType;
setType(value: PeerDHTMessageType): PeerDHTMessage;

Expand Down Expand Up @@ -422,7 +422,7 @@ export namespace PeerDHTMessage {
}
}

export class PeerDHTPingNodeMessage extends jspb.Message {
export class PeerDHTPingNodeMessage extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerDHTPingNodeMessage;

Expand All @@ -447,14 +447,14 @@ export namespace PeerDHTPingNodeMessage {
}
}

export class PeerDHTFindNodeMessage extends jspb.Message {
export class PeerDHTFindNodeMessage extends jspb.Message {
getPublicKey(): string;
setPublicKey(value: string): PeerDHTFindNodeMessage;

clearKNodesList(): void;
getKNodesList(): Array<PeerInfoMessage>;
setKNodesList(value: Array<PeerInfoMessage>): PeerDHTFindNodeMessage;
addKNodes(value: PeerInfoMessage, index?: number): PeerInfoMessage;
clearClosestPeersList(): void;
getClosestPeersList(): Array<PeerInfoMessage>;
setClosestPeersList(value: Array<PeerInfoMessage>): PeerDHTFindNodeMessage;
addClosestPeers(value?: PeerInfoMessage, index?: number): PeerInfoMessage;


serializeBinary(): Uint8Array;
Expand All @@ -470,7 +470,7 @@ export class PeerDHTFindNodeMessage extends jspb.Message {
export namespace PeerDHTFindNodeMessage {
export type AsObject = {
publicKey: string,
kNodesList: Array<PeerInfoMessage>,
closestPeersList: Array<PeerInfoMessage.AsObject>,
}
}

Expand Down
44 changes: 24 additions & 20 deletions proto/compiled/Peer_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -3327,7 +3327,8 @@ proto.peerInterface.PeerDHTFindNodeMessage.prototype.toObject = function(opt_inc
proto.peerInterface.PeerDHTFindNodeMessage.toObject = function(includeInstance, msg) {
var f, obj = {
publicKey: jspb.Message.getFieldWithDefault(msg, 1, ""),
kNodesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
closestPeersList: jspb.Message.toObjectList(msg.getClosestPeersList(),
proto.peerInterface.PeerInfoMessage.toObject, includeInstance)
};

if (includeInstance) {
Expand Down Expand Up @@ -3369,8 +3370,9 @@ proto.peerInterface.PeerDHTFindNodeMessage.deserializeBinaryFromReader = functio
msg.setPublicKey(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.addKNodes(value);
var value = new proto.peerInterface.PeerInfoMessage;
reader.readMessage(value,proto.peerInterface.PeerInfoMessage.deserializeBinaryFromReader);
msg.addClosestPeers(value);
break;
default:
reader.skipField();
Expand Down Expand Up @@ -3408,11 +3410,12 @@ proto.peerInterface.PeerDHTFindNodeMessage.serializeBinaryToWriter = function(me
f
);
}
f = message.getKNodesList();
f = message.getClosestPeersList();
if (f.length > 0) {
writer.writeRepeatedString(
writer.writeRepeatedMessage(
2,
f
f,
proto.peerInterface.PeerInfoMessage.serializeBinaryToWriter
);
}
};
Expand All @@ -3437,39 +3440,40 @@ proto.peerInterface.PeerDHTFindNodeMessage.prototype.setPublicKey = function(val


/**
* repeated string k_nodes = 2;
* @return {!Array<string>}
* repeated PeerInfoMessage closest_peers = 2;
* @return {!Array<!proto.peerInterface.PeerInfoMessage>}
*/
proto.peerInterface.PeerDHTFindNodeMessage.prototype.getKNodesList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
proto.peerInterface.PeerDHTFindNodeMessage.prototype.getClosestPeersList = function() {
return /** @type{!Array<!proto.peerInterface.PeerInfoMessage>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.peerInterface.PeerInfoMessage, 2));
};


/**
* @param {!Array<string>} value
* @param {!Array<!proto.peerInterface.PeerInfoMessage>} value
* @return {!proto.peerInterface.PeerDHTFindNodeMessage} returns this
*/
proto.peerInterface.PeerDHTFindNodeMessage.prototype.setKNodesList = function(value) {
return jspb.Message.setField(this, 2, value || []);
*/
proto.peerInterface.PeerDHTFindNodeMessage.prototype.setClosestPeersList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};


/**
* @param {string} value
* @param {!proto.peerInterface.PeerInfoMessage=} opt_value
* @param {number=} opt_index
* @return {!proto.peerInterface.PeerDHTFindNodeMessage} returns this
* @return {!proto.peerInterface.PeerInfoMessage}
*/
proto.peerInterface.PeerDHTFindNodeMessage.prototype.addKNodes = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
proto.peerInterface.PeerDHTFindNodeMessage.prototype.addClosestPeers = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.peerInterface.PeerInfoMessage, opt_index);
};


/**
* Clears the list making it empty but non-null.
* @return {!proto.peerInterface.PeerDHTFindNodeMessage} returns this
*/
proto.peerInterface.PeerDHTFindNodeMessage.prototype.clearKNodesList = function() {
return this.setKNodesList([]);
proto.peerInterface.PeerDHTFindNodeMessage.prototype.clearClosestPeersList = function() {
return this.setClosestPeersList([]);
};


Expand Down

0 comments on commit a39e7b1

Please sign in to comment.