-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to define user configuration. #240
Comments
Sorry for the delay on responding. What do you mean by user config settings? If you're asking about a configuration file like nginx's, Pingora's current config files are more limited than nginx's and are limited to environment setup, e.g. see the (as-of-today) YAML formatted |
I mean extand ServerConf with my own configuration parameters. |
I think your best bet is to use #[derive(Serialize, Deserialize)]
struct CombinedConf {
// All pingora configurations come in here
#[serde(flatten)]
base_conf: ServerConf,
// Any of your configurations can go here
#[serde(flatten)]
custom_conf: CustomConf,
}
#[derive(Serialize, Deserialize)]
struct CustomConf {
awesomeness_count: f64
// ...
} |
For certain format like yaml and json you can even add your custom field directly into the server_conf.yaml
The yaml above can be directly deserialized to |
This question has been stale for a week. It will be closed in an additional day if not updated. |
This issue has been closed because it has been stalled with no activity. |
How can I add new user config settings.
The text was updated successfully, but these errors were encountered: