reactive_graph_config_api/
config_manager.rs1use std::path::PathBuf;
2
3use springtime_di::injectable;
4
5use reactive_graph_config_model::GraphQLServerConfig;
6use reactive_graph_config_model::InstanceConfig;
7use reactive_graph_config_model::PluginsConfig;
8use reactive_graph_config_model::RemotesConfig;
9use reactive_graph_lifecycle::Lifecycle;
10
11#[injectable]
12pub trait ConfigManager: Send + Sync + Lifecycle {
13 fn get_instance_config_location(&self) -> PathBuf;
15
16 fn set_instance_config_location(&self, instance_config_location: PathBuf);
18
19 fn get_graphql_server_config_location(&self) -> PathBuf;
21
22 fn set_graphql_server_config_location(&self, graphql_server_config_location: PathBuf);
24
25 fn get_plugins_config_location(&self) -> PathBuf;
27
28 fn set_plugins_config_location(&self, plugins_config_location: PathBuf);
30
31 fn get_remotes_config_location(&self) -> PathBuf;
33
34 fn set_remotes_config_location(&self, remotes_config_location: PathBuf);
36
37 fn get_instance_config(&self) -> InstanceConfig;
39
40 fn set_instance_config(&self, instance_config: InstanceConfig);
42
43 fn read_instance_config(&self);
45
46 fn set_instance_name(&self, instance_name: &str);
48
49 fn set_instance_description(&self, instance_description: &str);
51
52 fn get_graphql_server_config(&self) -> GraphQLServerConfig;
54
55 fn set_graphql_server_config(&self, graphql_server_config: GraphQLServerConfig);
57
58 fn read_graphql_server_config(&self);
60
61 fn set_graphql_hostname(&self, hostname: &str);
63
64 fn set_graphql_port(&self, port: u16);
66
67 fn set_graphql_secure(&self, secure: bool);
69
70 fn set_graphql_ssl_certificate_path(&self, ssl_certificate_path: &str);
72
73 fn set_graphql_ssl_private_key_path(&self, ssl_private_key_path: &str);
75
76 fn set_graphql_shutdown_timeout(&self, shutdown_timeout: u64);
78
79 fn set_graphql_workers(&self, workers: usize);
81
82 fn get_graphql_default_context_path(&self) -> Option<String>;
84
85 fn set_graphql_default_context_path(&self, default_context_path: String);
87
88 fn get_plugins_config(&self) -> PluginsConfig;
90
91 fn set_plugins_config(&self, plugins_config: PluginsConfig);
93
94 fn read_plugins_config(&self);
96
97 fn set_disable_all_plugins(&self, disable_all_plugins: bool);
99
100 fn set_disabled_plugins(&self, disabled_plugins: Vec<String>);
102
103 fn set_enabled_plugins(&self, enabled_plugins: Vec<String>);
105
106 fn set_disable_hot_deploy(&self, disable_hot_deploy: bool);
108
109 fn set_hot_deploy_location(&self, hot_deploy_location: Option<String>);
111
112 fn set_install_location(&self, install_location: Option<String>);
114
115 fn get_remotes_config(&self) -> RemotesConfig;
117
118 fn set_remotes_config(&self, remotes: RemotesConfig);
120
121 fn read_remotes_config(&self);
123
124 fn write_remotes_config(&self);
126}