MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / getEventData

Function getEventData

test/unit/parser-tests.js:1271–1287  ·  view source on GitHub ↗
(eventType, value)

Source from the content-addressed store, hash-verified

1269}
1270
1271function getEventData(eventType, value) {
1272 const bodyArray = [];
1273 //EVENT TYPE
1274 bodyArray.push(utils.allocBufferFromArray([0, eventType.length]));
1275 bodyArray.push(utils.allocBufferFromString(eventType));
1276 //STATUS CHANGE DESCRIPTION
1277 bodyArray.push(utils.allocBufferFromArray([0, value.length]));
1278 bodyArray.push(utils.allocBufferFromString(value));
1279 //Address
1280 bodyArray.push(utils.allocBufferFromArray([4, 127, 0, 0, 1]));
1281 //Port
1282 bodyArray.push(utils.allocBufferFromArray([0, 0, 0, 200]));
1283
1284 const body = Buffer.concat(bodyArray);
1285 const header = new types.FrameHeader(2, 0, -1, types.opcodes.event, body.length);
1286 return {header: header, chunk: body};
1287}
1288
1289function buildParserAndExpect(validationFn) {
1290 const parser = newInstance();

Callers 1

parser-tests.jsFile · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected