Wiki

Clone wiki

RToggle / Home

RToggle

RToggle is a basic extensible feature toggling library.

Getting started with the Configuration Section Repository

If interested in just using the library the current version is available on Nuget. The following packages are required :

  • RToggle Core
  • RToggle.Repository.ConfigurationSection

Once installed the following would be all that's required to start using the library :

#!c#
var configRepo = new RToggle.Repository.ConfigurationSection.Repository();
var engine = new RToggle.Core.FeatureEngine(configRepo);
var feature = engine.GetFeature("TestTrue");

Remember to copy the sample configuration from the readme file included in RToggle.Repository.ConfigurationSection.

Sample Configuration Section

#!xml
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="RToggle" type="RToggle.Repository.ConfigurationSection.Config.RToggleSection, RToggle.Repository.ConfigurationSection" />
  </configSections>
  <RToggle>
    <standardFeatures>
      <feature name="TestTrue" isEnabled="true" isEstablished="false" />
      <feature name="TestFalse" isEnabled="false" isEstablished="false" />
      <feature name="TestTrueWithEstablished" isEnabled="true" isEstablished="true" />
      <feature name="TestFalseWithEstablished" isEnabled="false" isEstablished="true" />
    </standardFeatures>
    <timedFeatures>
      <timedFeature name="TimedFeatureOne" startDateTime="2008-05-01T07:34:42Z" endDateTime="2020-05-01T07:34:42Z" isEstablished="True"/>
      <timedFeature name="TimedFeatureTwo" startDateTime="2020-01-01T01:00:00Z" endDateTime="2020-05-01T07:34:42Z" isEstablished="false"/>
    </timedFeatures>
  </RToggle>
</configuration>

Multiple Repositories.

The current implementation can query multiple repositories to check for a feature, the repositories are checked in the order of registration and return on the first match.

Registration of multiple repositories is done in the ctor of the FeatureEngine.

#!c#
var engine = new FeatureEngine(new[]
                {
                  repoOne,
                  repoTeo
                });

Current available repositories

Future changes - Wishlist, coming soon.

Repo

  • MSSQL
  • Rest

Features

  • Dependant features (Feature x relies on y and z being enabled)

Notifications for established features

  • Email

Prerelease Nuget

Available at : [https://www.myget.org/F/rubble/]

Updated