Documentation
¶
Overview ¶
Package internal contains SDK implementation details that are shared between packages, but are not exposed to application code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureStoreStatus ¶
type FeatureStoreStatus struct {
// True if the store is currently usable. For a persistent store, this will be false if the last
// database operation failed and we have not yet seen evidence that the database is working.
Available bool
// True if the store may be out of date due to a previous outage, so the SDK should attempt to
// refresh all feature flag data and rewrite it to the store.
NeedsRefresh bool
}
FeatureStoreStatus is a description of whether a feature store is functioning normally.
type FeatureStoreStatusManager ¶
type FeatureStoreStatusManager struct {
// contains filtered or unexported fields
}
FeatureStoreStatusManager manages status subscriptions and can poll for recovery.
func NewFeatureStoreStatusManager ¶
func NewFeatureStoreStatusManager(availableNow bool, pollFn func() bool, refreshOnRecovery bool, loggers ldlog.Loggers) *FeatureStoreStatusManager
NewFeatureStoreStatusManager creates a new FeatureStoreStatusManager. The pollFn should return true if the store is available, false if not.
func (*FeatureStoreStatusManager) Close ¶
func (m *FeatureStoreStatusManager) Close()
Close shuts down all channels and goroutines used by the manager.
func (*FeatureStoreStatusManager) IsAvailable ¶
func (m *FeatureStoreStatusManager) IsAvailable() bool
IsAvailable tests whether the last known status was available.
func (*FeatureStoreStatusManager) Subscribe ¶
func (m *FeatureStoreStatusManager) Subscribe() FeatureStoreStatusSubscription
Subscribe opens a channel for status updates.
func (*FeatureStoreStatusManager) UpdateAvailability ¶
func (m *FeatureStoreStatusManager) UpdateAvailability(available bool)
UpdateAvailability signals that the store is now available or unavailable. If that is a change, an update will be sent (and, if the new status is unavailable, it will start polling for recovery).
type FeatureStoreStatusProvider ¶
type FeatureStoreStatusProvider interface {
// GetStoreStatus returns the current status of the store.
GetStoreStatus() FeatureStoreStatus
// StatusSubscribe creates a channel that will receive all changes in store status.
StatusSubscribe() FeatureStoreStatusSubscription
}
FeatureStoreStatusProvider is an optional interface that can be implemented by a FeatureStore. It allows other SDK components to detect whether the store is in a usable state.
type FeatureStoreStatusSubscription ¶
type FeatureStoreStatusSubscription interface {
// The channel for receiving updates.
Channel() <-chan FeatureStoreStatus
// Stops the subscription, closing the channel.
Close()
}
FeatureStoreStatusSubscription represents a subscription to feature store status updates.