Types
DropConn = proc (peer: PubSubPeer) {....gcsafe, raises: [Defect].}
- Source Edit
GetConn = proc (): Future[Connection] {....gcsafe, raises: [Defect].}
- Source Edit
OnEvent = proc (peer: PubSubPeer; event: PubsubPeerEvent) {....gcsafe, raises: [Defect].}
- Source Edit
PubSubObserver = ref object onRecv*: proc (peer: PubSubPeer; msgs: var RPCMsg) {....gcsafe, raises: [Defect].} onSend*: proc (peer: PubSubPeer; msgs: var RPCMsg) {....gcsafe, raises: [Defect].}
- Source Edit
PubSubPeer = ref object of RootObj getConn*: GetConn dropConn*: DropConn onEvent*: OnEvent codec*: string sendConn*: Connection address*: Option[MultiAddress] peerId*: PeerId handler*: RPCHandler observers*: ref seq[PubSubObserver] score*: float64 iWantBudget*: int iHaveBudget*: int maxMessageSize: int appScore*: float64 behaviourPenalty*: float64 when defined(libp2p_agents_metrics): shortAgent*: string
- Source Edit
PubsubPeerEvent = object kind*: PubSubPeerEventKind
- Source Edit
PubSubPeerEventKind {.pure.} = enum Connected, Disconnected
- Source Edit
RPCHandler = proc (peer: PubSubPeer; msg: RPCMsg): Future[void] {....gcsafe, raises: [Defect].}
- Source Edit
Procs
func `==`(a, b: PubSubPeer): bool {....raises: [Defect], tags: [].}
- Source Edit
proc connect(p: PubSubPeer) {....raises: [Defect], tags: [RootEffect].}
- Source Edit
proc connected(p: PubSubPeer): bool {....raises: [Defect], tags: [].}
- Source Edit
proc handle(p: PubSubPeer; conn: Connection): Future[void] {.stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
func hash(p: PubSubPeer): Hash {....raises: [Defect], tags: [].}
- Source Edit
proc hasObservers(p: PubSubPeer): bool {....raises: [Defect], tags: [].}
- Source Edit
proc new(T: typedesc[PubSubPeer]; peerId: PeerId; getConn: GetConn; dropConn: DropConn; onEvent: OnEvent; codec: string; maxMessageSize: int): T:type {....raises: [Defect].}
- Source Edit
func outbound(p: PubSubPeer): bool {....raises: [Defect], tags: [].}
- Source Edit
proc send(p: PubSubPeer; msg: RPCMsg; anonymize: bool) {....raises: [Defect], raises: [Defect], tags: [RootEffect, WriteIOEffect, TimeEffect].}
- Source Edit
proc sendEncoded(p: PubSubPeer; msg: seq[byte]) {....raises: [Defect], raises: [Defect], tags: [WriteIOEffect, TimeEffect, RootEffect].}
- Source Edit
func shortLog(p: PubSubPeer): string {....raises: [Defect], tags: [].}
- Source Edit
Templates
template formatItIMPL(it: PubSubPeer): auto
- Source Edit
Exports
-
formatItIMPL, hash, init, getField, shortLog, >=, getBytes, shortLog, write, init, public, shortLog, PeerId, ==, toBytes, <=, match, hex, init, write, init, validate, $, init, init, hasPublicKey, match, <, >, len, maxInlineKeyLength, cmp, extractPublicKey, newLPStreamWriteError, getProtoHeader, ProtoHeader, shortLog, init, random, $, MaError, ephemeral, MaPatternOp, ==, HTTP, initVBuffer, getProtoHeader, MaxSizeError, decodeProposal, getLen, ECDHEScheme, shortLog, closed, [], shcopy, shuffle, random, init, Secret, peekVarint, random, $, validate, mapOr, init, maxInlineKeyLength, TranscoderDNS, QUIC, init, getRequiredField, getField, supported, write, public, MAKind, getBytes, write, init, getField, checkFieldNumber, init, getRepeatedField, matchPartial, libp2p_pki_schemes, getBytes, len, ==, init, readLp, finish, init, initVBuffer, VBuffer, atEof, LPStreamTrackerName, peekSeq, payloadType, <=, LPStreamError, init, IP, protoAddress, decode, newRng, DefaultConnectionTimeout, checkValid, getPublicKey, WebSockets, CircuitRelay, extractPublicKey, mapAnd, new, hash, newLPStreamEOFError, init, ==, DNSADDR, hash, init, write, WSS, LPStream, writePacked, TimeoutHandler, init, closeImpl, readSeq, toBytes, shortLog, encode, TranscoderIP4, protoName, ==, toRawBytes, TranscoderIP6Zone, $, initProtoBuffer, newLPStreamReadError, init, match, writeLPVarint, CryptoResult, ProtoResult, WebRTCDirect, init, init, UDP, PeerInfo, TranscoderOnion, StreamTracker, write, init, isEmpty, writeArray, writeLp, LPStreamIncompleteError, PeerId, [], LPStreamEOFError, IP6, shortLog, initVBuffer, ProtoFlags, PKScheme, payload, stretchKeys, Connection, write, init, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, newLPStreamClosedError, close, init, $, initProtoBuffer, toException, DNS, init, upgrade, goffset, finish, getRawBytes, >, KeyPair, isUpgraded, init, high, toString, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, formatItIMPL, toBytes, DigestSheme, IPFS, mac, readOnce, isEmpty, MultiAddress, ProtoScalar, shortLog, LPStreamIncorrectDefect, hex, protocols, hash, HTTPS, tryAndWarn, LPError, getPtr, write, sign, readVarint, encode, MaResult, init, ProtoField, toBytes, writeSeq, init, &, DNS6, IpTransportProtocol, toOpenArray, allFuturesThrowing, IP4, TranscoderPort, isEnough, write, getField, init, createExchange, >=, init, payloadDomain, $, LPStreamLimitError, SignedPayload, toBytes, newLPStreamLimitError, write, keyOpenArray, match, $, isEmpty, LPStreamReadError, decode, getRequiredRepeatedField, newLPStreamIncompleteError, newLPStreamReadError, initProtoBuffer, MAProtocol, getPackedRepeatedField, initStream, contains, shortLog, DNS4, readArray, selectBest, newLPStreamIncorrectDefect, P2PPattern, Envelope, hasPublicKey, toException, init, isEnough, DNSANY, Reliable, hex, ProtoBuffer, closeImpl, write, decode, WS, init, encode, init, init, init, getField, match, getField, <, iv, onUpgrade, readLine, Eof, CryptoError, getField, append, MaPattern, vsizeof, peekArray, UNIX, PeerRecord, key, SupportedSchemes, getRepeatedField, LPStreamWriteError, getField, RsaDefaultKeySize, Unreliable, SupportedSchemesInt, random, checkFutures, macOpenArray, init, validate, protoCode, mapEq, getField, init, concat, TranscoderP2P, AddressInfo, ConnectionTrackerName, TranscoderIP6, new, write, EnvelopeError, encode, len, MaxMessageSize, createProposal, MaPatResult, Direction, InvalidVarintError, shortLog, write, getBytes, write, UTP, readVarint, verify, init, PublicKey, update, writeLp, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, init, initStream, getField, ephemeral, ivOpenArray, closeWithEOF, orError, decodeExchange, getField, MaInvalidAddress, LPStreamClosedError, writeVarint, items, write, getOrder, TranscoderUnix, SignedPeerRecord, join