Skip to content

@codesoul-co/hypha-adapters-local / local-filesystem-execution-artifact-store

模块用法

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

从包入口导入

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

import type {
  LocalArtifactGarbageCollectionResult,
  LocalFilesystemExecutionArtifactStoreOptions,
  LocalFilesystemExecutionArtifactStoreStats,
} from '@codesoul-co/hypha-adapters-local';

使用要点

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

公共导出

Symbol种类签名说明
LocalFilesystemExecutionArtifactStorenew LocalFilesystemExecutionArtifactStore(options: LocalFilesystemExecutionArtifactStoreOptions): LocalFilesystemExecutionArtifactStoreLocal Filesystem Execution Artifact Store 类,共公开 13 个构造函数或成员;精确签名见本条目的声明与成员表。
LocalArtifactGarbageCollectionResult接口interface LocalArtifactGarbageCollectionResultLocal Artifact Garbage Collection Result 接口,共包含 2 个公开字段或方法。
LocalFilesystemExecutionArtifactStoreOptions接口interface LocalFilesystemExecutionArtifactStoreOptionsLocal Filesystem Execution Artifact Store Options 接口,共包含 4 个公开字段或方法。
LocalFilesystemExecutionArtifactStoreStats接口interface LocalFilesystemExecutionArtifactStoreStatsLocal Filesystem Execution Artifact Store Stats 接口,共包含 3 个公开字段或方法。

LocalFilesystemExecutionArtifactStore

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

声明

text
export declare class LocalFilesystemExecutionArtifactStore implements ArtifactStoreProvider {
    readonly id: string;
    constructor(options: LocalFilesystemExecutionArtifactStoreOptions);
    capabilities(): Promise<ArtifactStoreCapabilities>;
    put(input: ArtifactPutRequest, options?: ArtifactOperationOptions): 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(): Promise<LocalFilesystemExecutionArtifactStoreStats>;
    collectGarbage(): Promise<LocalArtifactGarbageCollectionResult>;
}

公开成员

成员种类签名说明
capabilities方法capabilities(): Promise<ArtifactStoreCapabilities>公开方法;参数与返回类型以签名列为准。
close方法close(): Promise<void>公开方法;参数与返回类型以签名列为准。
collectGarbage方法collectGarbage(): Promise<LocalArtifactGarbageCollectionResult>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options: LocalFilesystemExecutionArtifactStoreOptions): LocalFilesystemExecutionArtifactStore创建该类的实例。
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, options?: ArtifactOperationOptions): Promise<ArtifactStorageRef>公开方法;参数与返回类型以签名列为准。
stats方法stats(): Promise<LocalFilesystemExecutionArtifactStoreStats>公开方法;参数与返回类型以签名列为准。

LocalArtifactGarbageCollectionResult

Local Artifact Garbage Collection Result 接口,共包含 2 个公开字段或方法。

声明

text
export interface LocalArtifactGarbageCollectionResult {
    deletedBlobs: number;
    reclaimedBytes: number;
}

契约成员

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

LocalFilesystemExecutionArtifactStoreOptions

Local Filesystem Execution Artifact Store Options 接口,共包含 4 个公开字段或方法。

声明

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

契约成员

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

LocalFilesystemExecutionArtifactStoreStats

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

声明

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

契约成员

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