datastore

package
v7.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package datastore is an internal package containing implementation types for the SDK's data store implementations (in-memory vs. cached persistent store) and related functionality. These types are not visible from outside of the SDK.

This does not include implementations of specific database integrations such as Redis. Those are implemented in separate repositories such as https://github.com/launchdarkly/go-server-sdk-redis-redigo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDataStoreEvaluatorDataProviderImpl

func NewDataStoreEvaluatorDataProviderImpl(store subsystems.ReadOnlyStore, loggers ldlog.Loggers) ldeval.DataProvider

NewDataStoreEvaluatorDataProviderImpl creates the internal implementation of the adapter that connects the Evaluator (from go-server-sdk-evaluation) with the data store.

func NewDataStoreStatusProviderImpl

func NewDataStoreStatusProviderImpl(
	store StatusMonitorable,
	dataStoreUpdates *DataStoreUpdateSinkImpl,
) interfaces.DataStoreStatusProvider

NewDataStoreStatusProviderImpl creates the internal implementation of DataStoreStatusProvider.

func NewInMemoryDataStore

func NewInMemoryDataStore(loggers ldlog.Loggers) subsystems.DataStore

NewInMemoryDataStore creates an instance of the in-memory data store. This is not part of the public API; it is always called through ldcomponents.inMemoryDataStore().

func NewPersistentDataStoreWrapper

func NewPersistentDataStoreWrapper(
	core subsystems.PersistentDataStore,
	dataStoreUpdates subsystems.DataStoreUpdateSink,
	cacheTTL time.Duration,
	loggers ldlog.Loggers,
) subsystems.DataStore

NewPersistentDataStoreWrapper creates the implementation of DataStore that we use for all persistent data stores. This is not visible in the public API; it is always called through ldcomponents.PersistentDataStore().

Types

type DataStoreUpdateSinkImpl

type DataStoreUpdateSinkImpl struct {
	// contains filtered or unexported fields
}

DataStoreUpdateSinkImpl is the internal implementation of DataStoreUpdateSink. It is exported because the actual implementation type, rather than the interface, is required as a dependency of other SDK components.

func NewDataStoreUpdateSinkImpl

func NewDataStoreUpdateSinkImpl(
	broadcaster *internal.Broadcaster[interfaces.DataStoreStatus],
) *DataStoreUpdateSinkImpl

NewDataStoreUpdateSinkImpl creates the internal implementation of DataStoreUpdateSink.

func (*DataStoreUpdateSinkImpl) UpdateStatus

func (d *DataStoreUpdateSinkImpl) UpdateStatus(newStatus interfaces.DataStoreStatus)

UpdateStatus is called from the data store to push a status update.

type StatusMonitorable added in v7.8.0

type StatusMonitorable interface {
	// IsStatusMonitoringEnabled returns true if this data store implementation supports status
	// monitoring.
	//
	// This is normally only true for persistent data stores created with ldcomponents.PersistentDataStore(),
	// but it could also be true for any custom DataStore implementation that makes use of the
	// statusUpdater parameter provided to the DataStoreFactory. Returning true means that the store
	// guarantees that if it ever enters an invalid state (that is, an operation has failed or it knows
	// that operations cannot succeed at the moment), it will publish a status update, and will then
	// publish another status update once it has returned to a valid state.
	//
	// The same value will be returned from DataStoreStatusProvider.IsStatusMonitoringEnabled().
	IsStatusMonitoringEnabled() bool
}

StatusMonitorable means a data store is capable of having its status monitored over time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL