IF Commons GitHub

exchange/names

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-bridge-exchange FR-001, 0007-bridge-exchange FR-002

What a medium holds of an exchange, and how it is named. A replica publishes each delta of its own rows once, as a file whose name says whose it is, which of the replica's rows it holds and what the delta is (its identity is the SHA-256 of its text, so a file never changes and two replicas that publish the same delta publish one file). A replica publishes the vector it holds as a file of its own, which it writes again as it grows. Nothing else is written to the medium.

import { deltaPath, parseDeltaPath } from "./names.ts";

Source: commons/anyfs-bridge/src/exchange/names.ts

2 of 9 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

DELTAS_PREFIXconstno test imports it
const DELTAS_PREFIX: "deltas/"

The prefix below which the deltas are kept.

VECTORS_PREFIXconstno test imports it
const VECTORS_PREFIX: "vectors/"

The prefix below which the vectors are kept.

deltasPrefixconstno test imports it
const deltasPrefix: () => Prefix

The prefix of the deltas of everyone.

vectorsPrefixconstno test imports it
const vectorsPrefix: () => Prefix

The prefix of the vectors of everyone.

DeltaNametypeno test imports it
type DeltaName = { readonly replica: ReplicaId; readonly from: number; readonly to: number; readonly id: string };

What the name of a delta file says: whose rows it holds, the numbers of the first and the last, and the identity of the delta.

deltaPathfunction
function deltaPath(name: DeltaName): Result<Path, string>

The path of a delta file.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

parseDeltaPathfunction
function parseDeltaPath(path: string): Result<DeltaName, string>

What the path of a file says of the delta in it, or why it is not the path of a delta.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

vectorPathfunctionno test imports it
function vectorPath(replica: ReplicaId): Path

The path of the vector a replica publishes.

parseVectorPathfunctionno test imports it
function parseVectorPath(path: string): Result<ReplicaId, string>

The replica a vector file is of, or why the path is not one.

Titles, headings, exports, tables, columns and requirements. Esc closes.