Skip to main content

NewDataStoreWithContext

Creates a new Data Store with the supplied configuration and context.

def NewDataStoreWithContext(
ctx: context.Context,
cfg: *Config,
scope: promutils.Scope
) - > s *DataStore, err

Creates a new Data Store with the supplied config and context.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
cfg*ConfigThe configuration object used to initialize and refresh the Data Store.
scopepromutils.ScopeThe Prometheus scope for metrics collection within the Data Store.

Returns

TypeDescription
s *DataStore, errA new DataStore instance and an error if the configuration refresh fails.