fgb-vt - v1.0.6
    Preparing search index...

    Interface Connector

    interface Connector {
        cacheNamespace?: string;
        close(): Promise<void>;
        hints?: ConnectorHints;
        read(
            path: string,
            offset: number,
            length: number,
            options?: ReadOptions,
        ): Promise<Uint8Array<ArrayBufferLike>>;
        readHead?(
            path: string,
            length: number,
            options?: ReadOptions,
        ): Promise<ReadHeadResult>;
        readRanges(
            path: string,
            ranges: readonly { length: number; offset: number }[],
            options?: ReadOptions,
        ): Promise<Uint8Array<ArrayBufferLike>[]>;
    }

    Implemented by

    Index
    cacheNamespace?: string

    Optional: identifies the storage this connector reads, so cached headers and index pages are shared only between connectors that resolve a path to the same file.

    Connectors with equal namespaces must map equal paths to the same resource. Without a namespace, cache entries are private to the connector instance (and a persistent cache cannot be reused by another process). The built-in connectors set local, http and s3:<endpoint>.

    Optional tuning hints for the pipeline.

    • Release all resources held by this connector (pooled connections, open file handles, SDK clients, etc.).

      Calling close() on an already-closed connector should be a safe no-op. The built-in connectors re-acquire resources if used again afterwards.

      Returns Promise<void>

      Resolves when all resources have been released.

    • Read a contiguous byte range from the resource at path.

      The path format is connector-specific (filesystem path, URL, S3 URI, etc.).

      Parameters

      • path: string

        Connector-specific resource identifier.

      • offset: number

        Zero-based byte offset to begin reading from.

      • length: number

        Number of bytes to read.

      • Optionaloptions: ReadOptions

        Optional version check and abort signal.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The requested byte range as a Uint8Array. The returned array may be shorter than length if the resource is smaller than offset + length.

      If the resource cannot be read (file not found, network error, permission denied, etc.).

    • Optional: read the first length bytes of a resource together with its total size and version tag.

      When absent, the pipeline falls back to read and treats size and version as unknown.

      Parameters

      • path: string

        Connector-specific resource identifier.

      • length: number

        Number of leading bytes to read.

      • Optionaloptions: ReadOptions

        Optional abort signal.

      Returns Promise<ReadHeadResult>

      The leading bytes and the resource metadata.

    • Read multiple byte ranges from the same resource.

      Implementations may batch, parallelize, or pipeline these reads to optimize throughput for the underlying backend. The returned array preserves the order of the input ranges.

      Parameters

      • path: string

        Connector-specific resource identifier.

      • ranges: readonly { length: number; offset: number }[]

        Array of { offset, length } byte-range descriptors.

      • Optionaloptions: ReadOptions

        Optional version check and abort signal, applied to every range.

      Returns Promise<Uint8Array<ArrayBufferLike>[]>

      Array of Uint8Array chunks corresponding positionally to the input ranges.

      If any individual range read fails.