NewInMemoryRawStore
Initializes and returns a new in-memory raw data store. This function creates an InMemoryStore instance, which uses a map to store raw file data in memory, and sets up its internal copy mechanism.
def NewInMemoryRawStore(
context: context.Context,
Config: *Config,
metrics: *dataStoreMetrics
) - > RawStore, error
Creates and initializes a new in-memory raw data store. This store is suitable for testing or scenarios where data persistence is not required, as all data is held in memory and lost when the application terminates.
Parameters
| Name | Type | Description |
|---|---|---|
| context | context.Context | The context for the operation, typically used for cancellation or deadlines. It is not directly used in this function's logic. |
| Config | *Config | Configuration settings for the raw store. It is not directly used in this function's logic for an in-memory store. |
| metrics | *dataStoreMetrics | Metrics collection object to track operations within the data store, specifically for copy operations. |
Returns
| Type | Description |
|---|---|
RawStore, error | A new instance of RawStore that stores data in memory, and an error if the store could not be initialized. |