Package-level declarations

Types

Link copied to clipboard
data class FeatureStats(val total: Int, val enabled: Int, val disabled: Int, val withPermissions: Int, val withStrategy: Int, val groups: Int)

Aggregated statistics about features in an FF4k instance.

Link copied to clipboard
class FF4k(val featureStore: FeatureStore = InMemoryFeatureStore(), val propertyStore: PropertyStore = InMemoryPropertyStore(), val source: FF4k.Source = Source.KotlinApi, val autoCreate: Boolean = false)

The primary entry point and facade for the FF4K feature flag library.

Functions

Link copied to clipboard
suspend fun FF4k.checkAll(vararg featureIds: String, executionContext: FlippingExecutionContext? = null): Boolean

Check if all features in the list are enabled.

Link copied to clipboard
suspend fun FF4k.checkAny(vararg featureIds: String, executionContext: FlippingExecutionContext? = null): Boolean

Check if any feature in the list is enabled.

Link copied to clipboard

Get all disabled features.

Link copied to clipboard

Get all enabled features.

Link copied to clipboard
suspend fun FF4k.featuresWithPermission(permission: String): List<Feature>

Get features with a specific permission.

Link copied to clipboard

Get features with a flipping strategy.

Link copied to clipboard
inline suspend fun <T> FF4k.ifEnabled(featureId: String, executionContext: FlippingExecutionContext? = null, block: () -> T): T?

Execute a block if the feature is enabled.

Link copied to clipboard
inline suspend fun <T> FF4k.ifEnabledOrElse(featureId: String, executionContext: FlippingExecutionContext? = null, enabled: () -> T, disabled: () -> T): T

Execute one block if the feature is enabled, another if disabled.

Link copied to clipboard
suspend fun FF4k.report(): String

Get a summary report of all features.

Link copied to clipboard
suspend fun FF4k.stats(): FeatureStats

Get statistics about features.

Link copied to clipboard
inline suspend fun FF4k.whenEnabled(featureId: String, executionContext: FlippingExecutionContext? = null, block: () -> Unit)

Execute a block with side effects if the feature is enabled.