GCSArtifact服务(Service)

class GcsArtifactService(bucketName: String, storageClient: Storage) : ArtifactService

An artifact service implementation using Google Cloud Storage (GCS).

The blob name format used depends on whether the filename has a user namespace:

  • For files with user namespace (starting with "user:"): {appName}/{userId}/user/{filename}/{version}

  • For regular session-scoped files: {appName}/{userId}/{sessionId}/{filename}/{version}

A session whose id is literally user therefore shares the user-scope prefix, and listArtifactKeys reports its session-scoped filenames to that user's other sessions, which cannot load them.

构造函数(Constructors)

Link copied to clipboard
constructor(bucketName: String, storageClient: Storage)

函数

Link copied to clipboard
open suspend override fun deleteArtifact(sessionKey: SessionKey, filename: String)

删除一个工件(artifact)。

Link copied to clipboard
open suspend override fun listArtifactKeys(sessionKey: SessionKey): List<String>

列出当前会话中可见的文件名:包括会话自身生成的文件以及用户创建的文件。 user: ones.

Link copied to clipboard
open suspend override fun listVersions(sessionKey: SessionKey, filename: String): List<Int>

列出某个软件组件的所有版本(以修订版本号的形式表示)。

Link copied to clipboard
open suspend override fun loadArtifact(sessionKey: SessionKey, filename: String, version: Int? = null): Part?

获取一个工件(artifact)。

Link copied to clipboard
open suspend override fun saveAndReloadArtifact(sessionKey: SessionKey, filename: String, artifact: Part): Part

保存一个“artefact”(即某种数据或对象),并在文件数据(fileData)可用时将其一并返回。

Link copied to clipboard
open suspend override fun saveArtifact(sessionKey: SessionKey, filename: String, artifact: Part): Int

用于保存某个“文物”(即某个具有特殊价值或历史意义的物品)。