reactive_graph_server/shared/config/
graphql.rs

1use clap::Parser;
2
3#[derive(Parser, Debug)]
4pub struct GraphQLServerConfigArgs {
5    /// The hostname to bind the GraphQL HTTP server.
6    #[arg(long, env = "REACTIVE_GRAPH_HOSTNAME")]
7    pub hostname: Option<String>,
8
9    /// The port to bind the GraphQL HTTP server.
10    #[arg(long, env = "REACTIVE_GRAPH_PORT")]
11    pub port: Option<u16>,
12
13    /// If true, HTTPS is enabled.
14    #[arg(long, env = "REACTIVE_GRAPH_SECURE")]
15    pub secure: Option<bool>,
16
17    /// The location of the certificate.
18    #[arg(long, env = "REACTIVE_GRAPH_SSL_CERTIFICATE_PATH")]
19    pub ssl_certificate_path: Option<String>,
20
21    /// The location of the private key.
22    #[arg(long, env = "REACTIVE_GRAPH_SSL_PRIVATE_KEY_PATH")]
23    pub ssl_private_key_path: Option<String>,
24
25    /// Timeout for graceful workers shutdown in seconds.
26    /// After receiving a stop signal, workers have this much time to finish serving requests.
27    /// Workers still alive after the timeout are force dropped.
28    /// By default, shutdown timeout sets to 30 seconds.
29    #[arg(long, env = "REACTIVE_GRAPH_INSTANCE_SHUTDOWN_TIMEOUT")]
30    pub shutdown_timeout: Option<u64>,
31
32    /// The number of workers to start.
33    /// The default worker count is the number of physical CPU cores available.
34    #[arg(short = 'w', long, env = "REACTIVE_GRAPH_WORKERS")]
35    pub workers: Option<usize>,
36
37    /// The default context path which redirects the root context to a web resource provider.
38    #[arg(short = 'c', long, env = "REACTIVE_GRAPH_DEFAULT_CONTEXT_PATH")]
39    pub default_context_path: Option<String>,
40}