Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Feature(val id: String, val enabled: Boolean = false, val description: String? = null, val group: String? = null, val permissions: Set<String> = emptySet(), val strategy: FlippingStrategy? = null, val properties: List<Property<Any>> = emptyList())
Link copied to clipboard
interface FeatureStore
Link copied to clipboard
class FF4k(val features: FeatureStore = InMemoryFeatureStore(), val properties: PropertyStore = InMemoryPropertyStore())

Entry point of the library: evaluates feature flags against a FeatureStore and exposes typed properties.

Link copied to clipboard
@Serializable
data class FF4kConfiguration(val features: List<Feature> = emptyList(), val properties: List<Property<Any>> = emptyList())

Declarative set of features and properties, loadable from JSON.

Link copied to clipboard
fun interface FlippingStrategy

Decides whether an enabled feature is active for the given evaluation context.

Link copied to clipboard
data class Property<out T : Any>(val name: String, val value: T, val description: String? = null)

A named, typed value. Supported value types for JSON serialization are String, Int, Long, Double, Boolean, Instant, LocalDate and LocalDateTime.

Link copied to clipboard
interface PropertyStore

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun FeatureStore.disableGroup(name: String)
Link copied to clipboard
suspend fun FeatureStore.enable(id: String): Feature
Link copied to clipboard
suspend fun FeatureStore.enableGroup(name: String)
Link copied to clipboard
suspend fun FeatureStore.group(name: String): List<Feature>