MCPcopy Create free account
hub / github.com/amqp-node/amqplib / encodeTable

Function encodeTable

lib/codec.js:82–95  ·  view source on GitHub ↗
(buffer, table, offset)

Source from the content-addressed store, hash-verified

80}
81
82function encodeTable(buffer, table, offset) {
83 const start = offset;
84 const unfinishedContainers = [];
85 offset = beginEncodingContainer(unfinishedContainers, buffer, table, offset);
86 while (unfinishedContainers.length > 0) {
87 const innermostContainer = unfinishedContainers.at(-1);
88 if (hasUnencodedEntries(innermostContainer)) {
89 offset = encodeNextEntry(unfinishedContainers, buffer, innermostContainer, offset);
90 } else {
91 finishEncodingContainer(unfinishedContainers, buffer, offset);
92 }
93 }
94 return offset - start;
95}
96
97function beginEncodingContainer(unfinishedContainers, buffer, values, offset) {
98 checkSpace(buffer, offset, 4);

Callers 10

encodeBasicConsumeFunction · 0.85
encodeConnectionStartFunction · 0.85
encodeConnectionStartOkFunction · 0.85
encodeExchangeDeclareFunction · 0.85
encodeExchangeBindFunction · 0.85
encodeExchangeUnbindFunction · 0.85
encodeQueueDeclareFunction · 0.85
encodeQueueBindFunction · 0.85
encodeQueueUnbindFunction · 0.85
encodeBasicPropertiesFunction · 0.85

Calls 4

beginEncodingContainerFunction · 0.85
hasUnencodedEntriesFunction · 0.85
encodeNextEntryFunction · 0.85
finishEncodingContainerFunction · 0.85

Tested by

no test coverage detected