Skip to main content

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

NameTypeDescription
contextcontext.ContextThe context for the operation, typically used for cancellation or deadlines. It is not directly used in this function's logic.
Config*ConfigConfiguration settings for the raw store. It is not directly used in this function's logic for an in-memory store.
metrics*dataStoreMetricsMetrics collection object to track operations within the data store, specifically for copy operations.

Returns

TypeDescription
RawStore, errorA new instance of RawStore that stores data in memory, and an error if the store could not be initialized.