Skip to content

@codesoul-co/hypha-adapters-local / in-memory-execution-artifact-store

模块用法

用于持久化并读取该边界的数据。In memory execution artifact store 模块公开 1 类、2 接口。

从包入口导入

ts
import {
  InMemoryExecutionArtifactStore,
} from '@codesoul-co/hypha-adapters-local';

import type {
  InMemoryExecutionArtifactStoreOptions,
  InMemoryExecutionArtifactStoreStats,
} from '@codesoul-co/hypha-adapters-local';

使用要点

  • 2 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 1 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。

公共导出

Symbol种类签名说明
InMemoryExecutionArtifactStorenew InMemoryExecutionArtifactStore(options?: InMemoryExecutionArtifactStoreOptions): InMemoryExecutionArtifactStoreIn Memory Execution Artifact Store 类,共公开 12 个构造函数或成员;精确签名见本条目的声明与成员表。
InMemoryExecutionArtifactStoreOptions接口interface InMemoryExecutionArtifactStoreOptionsIn Memory Execution Artifact Store Options 接口,共包含 3 个公开字段或方法。
InMemoryExecutionArtifactStoreStats接口interface InMemoryExecutionArtifactStoreStatsIn Memory Execution Artifact Store Stats 接口,共包含 3 个公开字段或方法。

InMemoryExecutionArtifactStore

In Memory Execution Artifact Store 类,共公开 12 个构造函数或成员;精确签名见本条目的声明与成员表。

声明

text
export declare class InMemoryExecutionArtifactStore implements ArtifactStoreProvider {
    readonly id: string;
    constructor(options?: InMemoryExecutionArtifactStoreOptions);
    capabilities(): Promise<ArtifactStoreCapabilities>;
    put(input: ArtifactPutRequest): Promise<ArtifactStorageRef>;
    get(input: ArtifactGetRequest, options?: ArtifactOperationOptions): Promise<ArtifactContent>;
    head(input: ArtifactStorageRef): Promise<ArtifactObjectMetadata | null>;
    exists(input: ArtifactStorageRef): Promise<boolean>;
    delete(input: ArtifactStorageRef): Promise<void>;
    copy(input: ArtifactCopyRequest): Promise<ArtifactStorageRef>;
    health(): Promise<ProviderHealth>;
    close(): Promise<void>;
    stats(): InMemoryExecutionArtifactStoreStats;
}

公开成员

成员种类签名说明
capabilities方法capabilities(): Promise<ArtifactStoreCapabilities>公开方法;参数与返回类型以签名列为准。
close方法close(): Promise<void>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options?: InMemoryExecutionArtifactStoreOptions): InMemoryExecutionArtifactStore创建该类的实例。
copy方法copy(input: ArtifactCopyRequest): Promise<ArtifactStorageRef>公开方法;参数与返回类型以签名列为准。
delete方法delete(input: ArtifactStorageRef): Promise<void>公开方法;参数与返回类型以签名列为准。
exists方法exists(input: ArtifactStorageRef): Promise<boolean>公开方法;参数与返回类型以签名列为准。
get方法get(input: ArtifactGetRequest, options?: ArtifactOperationOptions): Promise<ArtifactContent>公开方法;参数与返回类型以签名列为准。
head方法head(input: ArtifactStorageRef): Promise<ArtifactObjectMetadata | null>公开方法;参数与返回类型以签名列为准。
health方法health(): Promise<ProviderHealth>公开方法;参数与返回类型以签名列为准。
id属性readonly id: string公开属性;类型、只读和可选状态以签名列为准。
put方法put(input: ArtifactPutRequest): Promise<ArtifactStorageRef>公开方法;参数与返回类型以签名列为准。
stats方法stats(): InMemoryExecutionArtifactStoreStats公开方法;参数与返回类型以签名列为准。

InMemoryExecutionArtifactStoreOptions

In Memory Execution Artifact Store Options 接口,共包含 3 个公开字段或方法。

声明

text
export interface InMemoryExecutionArtifactStoreOptions {
    id?: string;
    maxObjectBytes?: number;
    now?: () => string;
}

契约成员

成员种类签名说明
id属性id?: string公开属性;类型、只读和可选状态以签名列为准。
maxObjectBytes属性maxObjectBytes?: number公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。

InMemoryExecutionArtifactStoreStats

In Memory Execution Artifact Store Stats 接口,共包含 3 个公开字段或方法。

声明

text
export interface InMemoryExecutionArtifactStoreStats {
    objects: number;
    blobs: number;
    storedBytes: number;
}

契约成员

成员种类签名说明
blobs属性blobs: number公开属性;类型、只读和可选状态以签名列为准。
objects属性objects: number公开属性;类型、只读和可选状态以签名列为准。
storedBytes属性storedBytes: number公开属性;类型、只读和可选状态以签名列为准。