1 unstable release
new 0.1.0-rc.0 | Dec 18, 2024 |
---|
#172 in Configuration
50 downloads per month
115KB
2K
SLoC
IBM Cloud App Configuration Rust SDK
The IBM Cloud App Configuration Rust SDK is used to perform feature flag and property evaluation based on the configuration on IBM Cloud App Configuration service.
Overview
IBM Cloud App Configuration is a centralized feature management and configuration service on IBM Cloud for use with web and mobile applications, microservices, and distributed environments.
Instrument your applications with App Configuration Rust SDK, and use the App Configuration dashboard, API or CLI to define feature flags or properties, organized into collections and targeted to segments. Change feature flag states in the cloud to activate or deactivate features in your application or environment, when required. You can also manage the properties for distributed applications centrally.
Pre-requisites
You will need the apikey
, region
and guid
for the AppConfiguration you want to connect to
from your IBMCloud account.
Usage
Note.- This crate is still under heavy development. Breaking changes are expected.
Create your client with the context (environment and collection) you want to connect to
use appconfiguration::{
AppConfigurationClient, AppConfigurationClientIBMCloud,
Entity, Result, Value, Feature
};
// Create the client connecting to the server
let client = AppConfigurationClientIBMCloud::new(&apikey, ®ion, &guid, &environment_id, &collection_id)?;
// Get the feature you want to evaluate for your entities
let feature = client.get_feature("AB_testing_feature")?;
// Evaluate feature value for each one of your entities
let user = MyEntity; // Implements Entity
let value_for_this_user = feature.get_value(&user)?.try_into()?;
if value_for_this_user {
println!("Feature {} is active for user {}", feature.get_name()?, user.get_id());
} else {
println!("User {} keeps using the legacy workflow", user.get_id());
}
License
This project is released under the Apache 2.0 license. The license's full text can be found in LICENSE.
Dependencies
~5–18MB
~261K SLoC