IF Commons GitHub

physical/nfs

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0006-anyfs-serve-nfs FR-010, 0006-anyfs-serve-nfs FR-011, 0006-anyfs-serve-nfs FR-002

The server of NFS: serveNfs hosts the service of a store on a TCP socket of the loopback (the NFS program and the mount protocol on the same port, which a mount names with port= and mountport=), reads the records of each connection, answers them in order, and bounds what a caller can make it hold: the connections, the size of a record and (in the service) the handles and the size of an object. It does not listen on any other address than the loopback, and it puts every buffer that holds a write when it is closed.

import { memoryStore } from "@intellectual-frontiers/anyfs/memory";
import { serveNfs } from "./nfs.ts";
const running = await serveNfs(memoryStore(), {});
running.kind === "ok" && running.value.mountCommand("/mnt/anyfs");

Source: commons/anyfs-serve/src/physical/nfs.ts

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

ServeNfsOptionstype
type ServeNfsOptions = NfsOptions & {
  /** The port; 0 asks for a free one. */
  readonly port?: number;
  /** The most connections at once: 16 by default. */
  readonly maxConnections?: number;
  /** The policy of the view; empty directories are kept as `.keep` objects by default, so that a directory made persists. */
  readonly policy?: Policy;
};

What the server is told besides what the service is.

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

NfsServingtypeno test imports it
type NfsServing = { readonly port: number; readonly hostname: string; /** How the boot of this server writes itsel… (574 characters)
type NfsServing = {
  readonly port: number;
  readonly hostname: string;
  /** How the boot of this server writes itself: the write verifier. */
  readonly boot: Uint8Array;
  /** The command that mounts the export on a Linux computer (`mount -t nfs`): the port is named, so that no portmapper is needed. */
  mountCommand(directory: string): string;
  /** How many attributes were accepted without effect. */
  dropped(): number;
  /** Puts what is held, stops listening and ends the connections. The failures to put are given. */
  close(): Promise<readonly string[]>;
};

A running server.

serveNfsfunction
function serveNfs(store: Store<Viewable>, options?: ServeNfsOptions): Promise<Result<NfsServing, string>>

Hosts a store as NFS version 3 on the loopback, or says why it cannot.

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

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