Types
AdvertiseError = object of LPError
- Source Edit
GenericRendezVous[E] = ref object of LPProtocol registered*: OffsettedSeq[RegisteredData] namespaces*: Table[string, seq[int]] rng*: ref HmacDrbgContext salt*: string expiredDT*: Moment registerDeletionLoop*: Future[void] sema*: AsyncSemaphore peers*: seq[PeerId] cookiesSaved*: Table[PeerId, Table[string, seq[byte]]] switch*: Switch minDuration*: Duration maxDuration*: Duration minTTL*: uint64 maxTTL*: uint64 peerRecordValidator*: PeerRecordValidator[E]
- Source Edit
PeerRecordValidator[E] = proc (_: E; spr: seq[byte]; peerId: PeerId): Result[ void, string] {....gcsafe.}
- Source Edit
RegisteredData = object expiration*: Moment peerId*: PeerId data*: Register
- Source Edit
RendezVousError = object of LPError
- Source Edit
Consts
MaximumDuration = (value: 259200000000000)
- Source Edit
MinimumAcceptedDuration = (value: 60000000000)
- Source Edit
MinimumDuration = (value: 7200000000000)
- Source Edit
RegistrationLimitPerPeer = 1000
- Source Edit
RendezVousCodec = "/rendezvous/1.0.0"
- Source Edit
Procs
proc advertise[E](rdv: GenericRendezVous[E]; ns: string; customPeerRecord: E; ttl: Duration; peers: seq[PeerId]): InternalRaisesFuture[void, (CancelledError, AdvertiseError)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc advertise[E](rdv: GenericRendezVous[E]; ns: string; ttl: Duration; peers: seq[PeerId]; sprBuff: seq[byte]): InternalRaisesFuture[ void, (CancelledError, AdvertiseError)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc checkPeerRecord(_: PeerRecord; spr: seq[byte]; peerId: PeerId): Result[ void, string] {....raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc countRegister[E](rdv: GenericRendezVous[E]; peerId: PeerId): int {. ...raises: [].}
- Source Edit
proc deletesRegister[E](rdv: GenericRendezVous[E]; interval = 1.minutes): InternalRaisesFuture[ void, (CancelledError,)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc discover[E](rdv: GenericRendezVous[E]; conn: Connection; d: Discover): InternalRaisesFuture[ void, (CancelledError, LPStreamError)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc new(T: typedesc[RendezVous]; rng: ref HmacDrbgContext = newRng(); minDuration = MinimumDuration; maxDuration = MaximumDuration): T:type {. ...raises: [].}
- Source Edit
proc new(T: typedesc[RendezVous]; rng: ref HmacDrbgContext = newRng(); minDuration = MinimumDuration; maxDuration = MaximumDuration; codec: string): T:type {....raises: [].}
- Source Edit
proc new(T: typedesc[RendezVous]; switch: Switch; rng: ref HmacDrbgContext = newRng(); minDuration = MinimumDuration; maxDuration = MaximumDuration): T:type {....raises: [].}
- Source Edit
proc register[E](rdv: GenericRendezVous[E]; conn: Connection; r: Register; peerRecord: E): Future[void] {....raises: [].}
- Source Edit
proc requestLocally[E](rdv: GenericRendezVous[E]; ns: string): seq[E] {. ...raises: [].}
- Source Edit
proc sendDiscoverResponse(conn: Connection; s: seq[Register]; cookie: Cookie): InternalRaisesFuture[ void, (CancelledError, LPStreamError)] {....stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc sendDiscoverResponseError(conn: Connection; status: ResponseStatus; text: string = ""): InternalRaisesFuture[void, (CancelledError, LPStreamError)] {....stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc sendRegisterResponse(conn: Connection; ttl: uint64): InternalRaisesFuture[ void, (CancelledError, LPStreamError)] {....stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc sendRegisterResponseError(conn: Connection; status: ResponseStatus; text: string = ""): InternalRaisesFuture[void, (CancelledError, LPStreamError)] {....stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc setup[E](rdv: GenericRendezVous[E]; switch: Switch) {....raises: [].}
- Source Edit
proc unregister[E](rdv: GenericRendezVous[E]; conn: Connection; u: Unregister) {. ...raises: [].}
- Source Edit
proc unsubscribe[E](rdv: GenericRendezVous[E]; ns: string): InternalRaisesFuture[ void, (RendezVousError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc unsubscribe[E](rdv: GenericRendezVous[E]; ns: string; peerIds: seq[PeerId]): InternalRaisesFuture[ void, (RendezVousError, CancelledError)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
proc unsubscribeLocally[E](rdv: GenericRendezVous[E]; ns: string) {....raises: [].}
- Source Edit
Methods
method advertise(rdv: RendezVous; ns: string; ttl: Opt[Duration] = Opt.none(Duration)): InternalRaisesFuture[ void, (CancelledError, AdvertiseError)] {.base, ...stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
method start[E](rdv: GenericRendezVous[E]): InternalRaisesFuture[void, (CancelledError,)] {....stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit
method stop[E](rdv: GenericRendezVous[E]): InternalRaisesFuture[void, void] {. ...stackTrace: false, raises: [], gcsafe, raises: [].}
- Source Edit