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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| key | string | The unique identifier for the cached output to retrieve. |
Returns
| Type | Description |
|---|---|
*models.CachedOutput, error | The 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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| output | *models.CachedOutput | The CachedOutput object to be stored or updated in the repository. |
Returns
| Type | Description |
|---|---|
error | An 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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| key | string | The unique identifier for the cached output to delete. |
Returns
| Type | Description |
|---|---|
error | An error if the operation failed, otherwise nil. |