InMemoryStore
No overview available.
Methods
Head()
@classmethod
def Head(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference)
) - > ([Metadata](../../flyteplugins/go/tasks/pluginmachinery/catalog/metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata), error)
Fetches the metadata for a given data reference without retrieving the actual data. Callers use this to check for existence or retrieve properties like size and modification time.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference to the data whose metadata is to be fetched. |
Returns
| Type | Description |
|---|---|
([Metadata](../../flyteplugins/go/tasks/pluginmachinery/catalog/metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata), error) | A tuple containing the metadata associated with the data reference and an error, if any occurred. |
List()
@classmethod
def List(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference),
maxItems: int,
cursor: [Cursor](cursor.md?sid=flytestdlib_storage_cursor)
) - > ([][DataReference](datareference.md?sid=flytestdlib_storage_datareference), [Cursor](cursor.md?sid=flytestdlib_storage_cursor), error)
Lists data references within a specified container, optionally filtered and paginated. Callers use this to discover available data items.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference to the container or prefix to list items from. |
| maxItems | int | The maximum number of items to return in a single listing operation. |
| cursor | [Cursor](cursor.md?sid=flytestdlib_storage_cursor) | A cursor for pagination, indicating where to resume listing from a previous call. |
Returns
| Type | Description |
|---|---|
([][DataReference](datareference.md?sid=flytestdlib_storage_datareference), [Cursor](cursor.md?sid=flytestdlib_storage_cursor), error) | A tuple containing a slice of data references, a cursor for pagination, and an error, if any occurred. |
ReadRaw()
@classmethod
def ReadRaw(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference)
) - > (io.ReadCloser, error)
Reads the raw content of the data associated with a given reference. Callers use this to retrieve the actual data bytes.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference to the data whose raw content is to be read. |
Returns
| Type | Description |
|---|---|
(io.ReadCloser, error) | A ReadCloser containing the raw data and an error, if any occurred. The caller is responsible for closing the ReadCloser. |
Delete()
@classmethod
def Delete(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference)
) - > error
Deletes the data associated with a given reference. Callers use this to remove data from the store.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference to the data to be deleted. |
Returns
| Type | Description |
|---|---|
error | An error, if any occurred during the deletion process. |
WriteRaw()
@classmethod
def WriteRaw(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference),
size: int64,
opts: [Options](../../flyteplugins/go/tasks/pluginmachinery/k8s/options.md?sid=flyteplugins_go_tasks_pluginmachinery_k8s_options),
raw: io.Reader
) - > error
Writes raw data to the store at the specified reference. Callers use this to store new data or overwrite existing data.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference where the raw data will be written. |
| size | int64 | The size of the raw data in bytes to be written. |
| opts | [Options](../../flyteplugins/go/tasks/pluginmachinery/k8s/options.md?sid=flyteplugins_go_tasks_pluginmachinery_k8s_options) | Optional parameters for the write operation, such as content type or metadata. |
| raw | io.Reader | The reader providing the raw data to be written. |
Returns
| Type | Description |
|---|---|
error | An error, if any occurred during the write operation. |
Clear()
@classmethod
def Clear(
ctx: context.Context
) - > error
Clears all data from the in-memory store. Callers use this to reset the store's state, typically for testing or cleanup.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
Returns
| Type | Description |
|---|---|
error | An error, if any occurred during the clearing process. |
GetBaseContainerFQN()
@classmethod
def GetBaseContainerFQN(
ctx: context.Context
) - > [DataReference](datareference.md?sid=flytestdlib_storage_datareference)
Retrieves the fully qualified name of the base container for the store. Callers use this to understand the root path for data storage.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
Returns
| Type | Description |
|---|---|
[DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The DataReference representing the fully qualified name of the base container. |
CreateSignedURL()
@classmethod
def CreateSignedURL(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference),
properties: [SignedURLProperties](signedurlproperties.md?sid=flytestdlib_storage_signedurlproperties)
) - > ([SignedURLResponse](signedurlresponse.md?sid=flytestdlib_storage_signedurlresponse), error)
Generates a pre-signed URL for accessing a specific data reference, allowing temporary, secure access without direct authentication. Callers use this to provide limited-time access to private data.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference to the data for which a signed URL is to be created. |
| properties | [SignedURLProperties](signedurlproperties.md?sid=flytestdlib_storage_signedurlproperties) | Properties defining the signed URL, such as expiration time and permissions. |
Returns
| Type | Description |
|---|---|
([SignedURLResponse](signedurlresponse.md?sid=flytestdlib_storage_signedurlresponse), error) | A SignedURLResponse containing the generated URL and an error, if any occurred. |