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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, allowing for cancellation and timeouts. |
| key | string | The unique identifier for the cached output to be retrieved. |
Returns
| Type | Description |
|---|---|
(*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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, allowing for cancellation and timeouts. |
| output | *models.CachedOutput | A pointer to the models.CachedOutput object to be stored or updated. |
Returns
| Type | Description |
|---|---|
error | An 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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, allowing for cancellation and timeouts. |
| key | string | The unique identifier of the cached output to be deleted. |
Returns
| Type | Description |
|---|---|
error | An error if the deletion fails, otherwise nil. |