IF Commons GitHub

physical/openers

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-anyfs-cli-surfaces FR-001, 0004-anyfs-cli-surfaces FR-002

The openers of the stores the program has itself (commons anyfs-cli 0004-anyfs-cli-surfaces FR-001, FR-002): a store in memory by name (one per name for a run, so a mount of it keeps what was written), a store of a folder (file:), and a store on a host reached by SSH (ssh://), which speaks only through the safe executor of Headless and its first contact with a host is the verb trust-host, never a flag. The other kinds of place are brought by their libraries through the kinds of the configuration; until one is, the place parses and says it has no store yet.

import { builtinKinds } from "./openers.ts";
builtinKinds(() => undefined, "/tmp/state", {}).map((k) => k.kind); // ["memory", "file", "ssh"]

Source: commons/anyfs-cli/src/physical/openers.ts

1 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.

targetIdOffunctionno test imports it
function targetIdOf(host: string): string

The id a host has as an ssh target: lower-case words joined by hyphens.

knownHostsOffunctionno test imports it
function knownHostsOf(ssh: SshInput, stateDir: string, env: (name: string) => string | undefined): { readonly repository: string; readonly user: string; }

The files of known hosts the program uses: its own, in its state folder, then the user's.

builtinKindsfunction
function builtinKinds(env: (name: string) => string | undefined, stateDir: string, ssh: SshInput, run?: RunLocal | undefined): readonly PlaceOpener[]

The openers of memory, of a folder and of a host reached by SSH. run is how the ssh program is run: the system's where it is left out.

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

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