AbstractFeatureStore

Base implementation of FeatureStore that provides common functionality.

This class implements many of the default behaviors for a feature store, allowing specific implementations to focus on the storage mechanism itself.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun addToGroup(featureId: String, groupName: String)

Add a feature to a group.

Link copied to clipboard
abstract suspend fun clear()

Clear all features from the store.

Link copied to clipboard
abstract suspend operator fun contains(featureId: String): Boolean

Check if a feature exists in the store.

Link copied to clipboard
open suspend override fun containsGroup(groupName: String): Boolean

Check if a group exists in the store.

Link copied to clipboard
abstract suspend fun count(): Int

Get the total number of features in the store.

Link copied to clipboard
open suspend override fun createOrUpdate(feature: Feature)

Create or update a feature (upsert operation).

Link copied to clipboard
open suspend override fun disable(featureId: String)

Disable a feature.

Link copied to clipboard
open suspend override fun disableGroup(groupName: String)

Disable all features associated with the specified group.

Link copied to clipboard
open suspend override fun enable(featureId: String)

Enable a feature.

Link copied to clipboard
open suspend override fun enableGroup(groupName: String)

Enable all features associated with the specified group.

Link copied to clipboard
abstract suspend operator fun get(featureId: String): Feature?

Read a feature from the store.

Link copied to clipboard
abstract suspend fun getAll(): Map<String, Feature>

Read all features from the store.

Link copied to clipboard
open suspend override fun getAllGroups(): Set<String>

Get all group names in the store.

Link copied to clipboard
open suspend override fun getGroup(groupName: String): Map<String, Feature>

Read all features in a group.

Link copied to clipboard
open suspend override fun getOrThrow(featureId: String): Feature

Read a feature from the store or throw an exception if not found.

Link copied to clipboard
open suspend override fun grantRoleToFeature(featureId: String, roleName: String)

Grant a role/permission to a feature.

Link copied to clipboard
abstract suspend fun isEmpty(): Boolean

Check if the store contains no features.

Link copied to clipboard
abstract suspend operator fun minusAssign(featureId: String)

Delete a feature from the store.

Link copied to clipboard
abstract suspend operator fun plusAssign(feature: Feature)

Create a new feature in the store.

Link copied to clipboard
open suspend override fun removeFromGroup(featureId: String, groupName: String)

Remove a feature from its group.

Link copied to clipboard
open suspend override fun revokeRoleFromFeature(featureId: String, roleName: String)

Revoke a role/permission from a feature.

Link copied to clipboard
open suspend override fun toggle(featureId: String)

Toggle a feature's enabled state.

Link copied to clipboard
abstract suspend fun update(feature: Feature)

Update an existing feature in the store.

Link copied to clipboard
abstract suspend fun updateFeature(featureId: String, transform: (Feature) -> Feature)

Update a feature using a transformation function.