All files / kernel-browser-runtime/src/rpc-handlers index.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 0/0
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112                                                                          4x                                                                         4x                                                                          
import { clearStateHandler, clearStateSpec } from './clear-state.ts';
import {
  collectGarbageHandler,
  collectGarbageSpec,
} from './collect-garbage.ts';
import {
  executeDBQueryHandler,
  executeDBQuerySpec,
} from './execute-db-query.ts';
import { getStatusHandler, getStatusSpec } from './get-status.ts';
import { isRevokedHandler, isRevokedSpec } from './is-revoked.ts';
import {
  launchSubclusterHandler,
  launchSubclusterSpec,
} from './launch-subcluster.ts';
import { pingVatHandler, pingVatSpec } from './ping-vat.ts';
import { queueMessageHandler, queueMessageSpec } from './queue-message.ts';
import { reloadConfigHandler, reloadConfigSpec } from './reload-config.ts';
import {
  reloadSubclusterHandler,
  reloadSubclusterSpec,
} from './reload-subcluster.ts';
import { restartVatHandler, restartVatSpec } from './restart-vat.ts';
import { revokeHandler, revokeSpec } from './revoke.ts';
import {
  terminateAllVatsHandler,
  terminateAllVatsSpec,
} from './terminate-all-vats.ts';
import {
  terminateSubclusterHandler,
  terminateSubclusterSpec,
} from './terminate-subcluster.ts';
import { terminateVatHandler, terminateVatSpec } from './terminate-vat.ts';
 
/**
 * Call-ee side handlers for the kernel control methods.
 */
export const rpcHandlers = {
  clearState: clearStateHandler,
  executeDBQuery: executeDBQueryHandler,
  getStatus: getStatusHandler,
  pingVat: pingVatHandler,
  reload: reloadConfigHandler,
  revoke: revokeHandler,
  isRevoked: isRevokedHandler,
  restartVat: restartVatHandler,
  queueMessage: queueMessageHandler,
  terminateAllVats: terminateAllVatsHandler,
  collectGarbage: collectGarbageHandler,
  terminateVat: terminateVatHandler,
  launchSubcluster: launchSubclusterHandler,
  reloadSubcluster: reloadSubclusterHandler,
  terminateSubcluster: terminateSubclusterHandler,
} as {
  clearState: typeof clearStateHandler;
  executeDBQuery: typeof executeDBQueryHandler;
  getStatus: typeof getStatusHandler;
  pingVat: typeof pingVatHandler;
  reload: typeof reloadConfigHandler;
  revoke: typeof revokeHandler;
  isRevoked: typeof isRevokedHandler;
  restartVat: typeof restartVatHandler;
  queueMessage: typeof queueMessageHandler;
  terminateAllVats: typeof terminateAllVatsHandler;
  collectGarbage: typeof collectGarbageHandler;
  terminateVat: typeof terminateVatHandler;
  launchSubcluster: typeof launchSubclusterHandler;
  reloadSubcluster: typeof reloadSubclusterHandler;
  terminateSubcluster: typeof terminateSubclusterHandler;
};
 
/**
 * Call-er side method specs for the kernel control methods.
 */
export const rpcMethodSpecs = {
  clearState: clearStateSpec,
  executeDBQuery: executeDBQuerySpec,
  getStatus: getStatusSpec,
  pingVat: pingVatSpec,
  reload: reloadConfigSpec,
  revoke: revokeSpec,
  isRevoked: isRevokedSpec,
  restartVat: restartVatSpec,
  queueMessage: queueMessageSpec,
  terminateAllVats: terminateAllVatsSpec,
  collectGarbage: collectGarbageSpec,
  terminateVat: terminateVatSpec,
  launchSubcluster: launchSubclusterSpec,
  reloadSubcluster: reloadSubclusterSpec,
  terminateSubcluster: terminateSubclusterSpec,
} as {
  clearState: typeof clearStateSpec;
  executeDBQuery: typeof executeDBQuerySpec;
  getStatus: typeof getStatusSpec;
  pingVat: typeof pingVatSpec;
  reload: typeof reloadConfigSpec;
  revoke: typeof revokeSpec;
  isRevoked: typeof isRevokedSpec;
  restartVat: typeof restartVatSpec;
  queueMessage: typeof queueMessageSpec;
  terminateAllVats: typeof terminateAllVatsSpec;
  collectGarbage: typeof collectGarbageSpec;
  terminateVat: typeof terminateVatSpec;
  launchSubcluster: typeof launchSubclusterSpec;
  reloadSubcluster: typeof reloadSubclusterSpec;
  terminateSubcluster: typeof terminateSubclusterSpec;
};
 
type Handlers = (typeof rpcHandlers)[keyof typeof rpcHandlers];
 
export type KernelControlMethod = Handlers['method'];