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. Callers use this to retrieve previously stored computation results.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.
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. Callers use this to persist computation results for future retrieval.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.
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 using its unique key. Callers use this to invalidate or clean up old cached data.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, allowing for cancellation and timeouts.
keystringThe unique identifier for the cached output to delete.

Returns

TypeDescription
errorAn error if the operation failed, otherwise nil.