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, used for cancellation and deadlines.
keystringThe unique identifier for the cached output to retrieve.

Returns​

TypeDescription
*models.CachedOutput, errorThe retrieved CachedOutput object if found, and an error if the operation failed or the key was not found.

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, used for cancellation and deadlines.
output*models.CachedOutputThe CachedOutput object to be stored or updated in the repository.

Returns​

TypeDescription
errorAn error if the operation failed, 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 clean up old or no longer needed cached data.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
keystringThe unique identifier of the cached output to delete.

Returns​

TypeDescription
errorAn error if the operation failed, otherwise nil.