VexillaClient (vexilla_client v1.0.1)
VexillaClient is the core module of this SDK. Most interaction with Vexilla and your feature flags will be through this module.
Summary
Functions
Create a config for the VexillaClient. This config will need to be passed to all subsequent module functions.
Fetches the flags for a specific flag group. Can use the ID or the name of the group for the lookup.
Fetches the manifest file for facilitating name->id lookups. Does not set the value on the client. You would need to call set_manifest
after. Alternatively, you can use sync_manifest
to do both steps with less code.
Sets a fetched flag group within the Client instance.
Sets a fetched manifest within the VexillaClient instance. It can also be useful for mocking flags for testing.
Checks if a toggle, gradual, or selective flag should be enabled. Other methods exist for other flag types, such as value.
Checks if a toggle, gradual, or selective flag should be enabled. Uses a custom instance ID rather than the one set in the Client. Other methods exist for other flag types, such as value.
Sets a fetched flag group within the Client instance.
Fetches and sets the manifest within the client to facilitate name->Id lookups.
Gets an environment specific string or number value and falls back to a default if the feature is outside of its schedule.
Functions
create_config(base_url, environment, instance_id)
Create a config for the VexillaClient. This config will need to be passed to all subsequent module functions.
get_flags!(config, group_name_or_id, http_callback)
Fetches the flags for a specific flag group. Can use the ID or the name of the group for the lookup.
get_manifest!(config, http_callback)
Fetches the manifest file for facilitating name->id lookups. Does not set the value on the client. You would need to call set_manifest
after. Alternatively, you can use sync_manifest
to do both steps with less code.
set_flags(config, group)
Sets a fetched flag group within the Client instance.
set_manifest(config, manifest)
Sets a fetched manifest within the VexillaClient instance. It can also be useful for mocking flags for testing.
should!(config, group_name_or_id, feature_name_or_id)
Checks if a toggle, gradual, or selective flag should be enabled. Other methods exist for other flag types, such as value.
should_custom!(config, group_name_or_id, feature_name_or_id, custom_instance_id)
Checks if a toggle, gradual, or selective flag should be enabled. Uses a custom instance ID rather than the one set in the Client. Other methods exist for other flag types, such as value.
sync_flags!(config, group_name_or_id, http_callback)
Sets a fetched flag group within the Client instance.
sync_manifest!(config, http_callback)
Fetches and sets the manifest within the client to facilitate name->Id lookups.
value!(config, group_name_or_id, feature_name_or_id, default_value)
Gets an environment specific string or number value and falls back to a default if the feature is outside of its schedule.