Skip to main content

CachedOutputRepo

No overview available.

Methods


Get()

@classmethod
def Get(
ctx: context.Context,
key: string
) - > (*models.CachedOutput, error)

Fetches a cached output from the repository using its unique key. This method is used to retrieve previously stored computation results or data.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, allowing for cancellation and timeouts.
keystringThe unique identifier for the cached output to be retrieved.

Returns

TypeDescription
(*models.CachedOutput, error)A pointer to the models.CachedOutput object if found, and an error if the retrieval fails.

Put()

@classmethod
def Put(
ctx: context.Context,
output: *models.CachedOutput
) - > error

Stores a new cached output or updates an existing one in the repository. This method is used to persist computation results or data for future retrieval.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, allowing for cancellation and timeouts.
output*models.CachedOutputA pointer to the models.CachedOutput object to be stored or updated.

Returns

TypeDescription
errorAn error if the operation fails, otherwise nil.

Delete()

@classmethod
def Delete(
ctx: context.Context,
key: string
) - > error

Removes a cached output from the repository based on its unique key. This method is used to invalidate or clear outdated cached data.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, allowing for cancellation and timeouts.
keystringThe unique identifier of the cached output to be deleted.

Returns

TypeDescription
errorAn error if the deletion fails, otherwise nil.