Runtime configuration settings framework.
Types
Name |
Description |
Parses command line arguments into folly::settings. |
|
An immutable snapshot of the set of frozen setting projects. |
|
Interface for applying string‐based setting changes to a snapshot. |
|
Static information about the setting definition |
|
Type containing the string representation of a setting as well as the static metadata associated with it. Used as the "source" in setting conversion. |
|
This class is a proxy for working with folly::settings represented as strings. It can apply changes to these folly::settings via snapshot provided by user. Changes are not going to be published by this class, it is callers resposibility to commit/publish cahnges from snapshot into global state. |
|
Captures the current state of all setting values and allows updating multiple settings at once, with verification and rollback. |
Type Aliases
Name |
Description |
Result of a setting update operation: Unit on success or a SetErrorCode. |
Enums
Name |
Description |
Outcome of parsing command line arguments. |
|
Indicates whether a setting accepts overrides from the command line. |
|
Indicates whether a setting can change after initialization. |
|
Error codes for a failed setting update. |
Functions
Name |
Description |
Like parseTo in folly/Conv.h, but the "source" is SettingValueAndMetadata instead of a StringPiece. Defaults to folly::tryTo<T>(StringPiece) but can be overridden using ADL for user defined types. |
|
Freezes immutable settings ‐ preventing subsequent mutation attempts. It's up to the caller to call this function after settings have been initialized. |
|
Returns a snapshot of the current set of frozen setting projects. |
|
Returns the metadata for all registered settings in the process. |
|
Returns the default value of a setting by name, if it exists and has type T. |
|
Gets a folly::observer::Observer<T> for a given setting. For example: folly::settings::getObserver(FOLLY_SETTING(project, retention)) |
|
Returns the metadata for a setting by name, if it exists. |
|
Reports whether immutable settings for a project have been frozen. |
|
Main function to parse arguments folly::settings. This function parses command line arguments into folly::settings. It moves all positional, ‐‐help, not recognized flags and their values to the end of the argv array. It stops parsing arguments after '‐‐' is encoutered. |
|
Outputs help message into stderr. May terminate program if error was encoutered during arguments parsing or exit is requested by caller. |
|
Converts a setting value and metadata to type T, throwing on error. |
|
Returns the string representation of a set error code. |
|
Conversion functions for converting a SettingValueAndMetadata to a setting type T. Implementation is similar to folly/Conv and allows for customization using the convertTo function above. |