@maschinenlesbar.org/openka-cli
    Preparing search index...

    Interface BlobStore

    The corpus, as the roles that make it up.

    Store is their intersection and nothing in the codebase has to change because of the split — but a consumer that only reads the catalog can now say so, and a test double for it does not have to implement blob addressing, index sharding and artifact storage to compile. DiscoverOptions already took this shape by hand (Pick<Store, "loadArtifact">); these are the seams it was reaching for.

    The file store draws exactly these lines with section separators, which is the class saying out loud that it is nine concerns wearing one name.

    interface BlobStore {
        assertBlobStore?(): void;
        blobDigests(): string[];
        blobPath(sha256: string): string;
        deleteBlob(sha256: string): void;
        getBlob(sha256: string): Buffer;
        hasBlob(sha256: string): boolean;
        putBlob(data: Buffer): string;
    }

    Hierarchy (View Summary)

    Index
    • Throw StoreError when the blobs cannot be reached at all — a blob directory on a drive that is not mounted. Optional: a store whose blobs are always there (the in-memory double) has nothing to check.

      Returns void

    • The digest of every blob held, sorted.

      Returns string[]

    • Filesystem path of a stored blob — what ka open hands to the OS.

      Parameters

      • sha256: string

      Returns string

    • Remove a stored blob; nothing happens when there is none. ka rm --blobs only (issue #28).

      Parameters

      • sha256: string

      Returns void

    • Parameters

      • sha256: string

      Returns Buffer

    • Parameters

      • sha256: string

      Returns boolean

    • Store bytes under their own digest; returns the digest. Idempotent.

      Parameters

      • data: Buffer

      Returns string