GcsArtifactService

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}

Constructors

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

Functions

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

Deletes an artifact.

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

Lists the filenames of all artifacts within a session.

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

Lists all the versions (as revision IDs) of an artifact.

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

Gets an artifact.

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

Saves an artifact and returns it with fileData if available.

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

Saves an artifact.