2018-08-28 14:43:46 +00:00
|
|
|
#ifndef ODYSSEY_CONFIG_H
|
|
|
|
#define ODYSSEY_CONFIG_H
|
2017-05-24 11:57:15 +00:00
|
|
|
|
|
|
|
/*
|
2018-03-12 14:03:15 +00:00
|
|
|
* Odyssey.
|
2017-05-24 11:57:15 +00:00
|
|
|
*
|
2018-04-04 13:19:58 +00:00
|
|
|
* Scalable PostgreSQL connection pooler.
|
2020-04-02 11:00:56 +00:00
|
|
|
*/
|
2017-05-24 11:57:15 +00:00
|
|
|
|
2018-12-06 14:23:15 +00:00
|
|
|
typedef struct od_config_listen od_config_listen_t;
|
2020-04-02 11:00:56 +00:00
|
|
|
typedef struct od_config od_config_t;
|
2017-05-24 11:57:15 +00:00
|
|
|
|
2020-12-28 10:43:31 +00:00
|
|
|
typedef enum {
|
2018-12-06 14:23:15 +00:00
|
|
|
OD_CONFIG_TLS_DISABLE,
|
|
|
|
OD_CONFIG_TLS_ALLOW,
|
|
|
|
OD_CONFIG_TLS_REQUIRE,
|
|
|
|
OD_CONFIG_TLS_VERIFY_CA,
|
|
|
|
OD_CONFIG_TLS_VERIFY_FULL
|
|
|
|
} od_config_tls_t;
|
2017-05-24 11:57:15 +00:00
|
|
|
|
2020-12-28 10:43:31 +00:00
|
|
|
struct od_config_listen {
|
2020-04-02 11:00:56 +00:00
|
|
|
char *host;
|
|
|
|
int port;
|
|
|
|
int backlog;
|
|
|
|
od_config_tls_t tls_mode;
|
|
|
|
char *tls;
|
|
|
|
char *tls_ca_file;
|
|
|
|
char *tls_key_file;
|
|
|
|
char *tls_cert_file;
|
|
|
|
char *tls_protocols;
|
|
|
|
int client_login_timeout;
|
|
|
|
od_list_t link;
|
2020-11-23 11:55:42 +00:00
|
|
|
int compression;
|
2017-08-28 13:59:41 +00:00
|
|
|
};
|
|
|
|
|
2020-12-28 10:43:31 +00:00
|
|
|
struct od_config {
|
2020-04-02 11:00:56 +00:00
|
|
|
int daemonize;
|
|
|
|
int priority;
|
2020-07-26 07:58:15 +00:00
|
|
|
/* logging */
|
2020-04-02 11:00:56 +00:00
|
|
|
int log_to_stdout;
|
|
|
|
int log_debug;
|
|
|
|
int log_config;
|
|
|
|
int log_session;
|
|
|
|
int log_query;
|
|
|
|
char *log_file;
|
|
|
|
char *log_format;
|
|
|
|
int log_stats;
|
|
|
|
int log_syslog;
|
|
|
|
char *log_syslog_ident;
|
|
|
|
char *log_syslog_facility;
|
2020-07-26 07:58:15 +00:00
|
|
|
/* */
|
2020-04-02 11:00:56 +00:00
|
|
|
int stats_interval;
|
2020-07-26 07:58:15 +00:00
|
|
|
/* system related settings */
|
2020-04-02 11:00:56 +00:00
|
|
|
char *pid_file;
|
|
|
|
char *unix_socket_dir;
|
|
|
|
char *unix_socket_mode;
|
2020-07-26 07:58:15 +00:00
|
|
|
char *locks_dir;
|
|
|
|
/* sigusr2 etc */
|
|
|
|
int graceful_die_on_errors;
|
|
|
|
int enable_online_restart_feature;
|
|
|
|
int bindwith_reuseport;
|
|
|
|
/* */
|
2020-04-02 11:00:56 +00:00
|
|
|
int readahead;
|
|
|
|
int nodelay;
|
2020-07-21 18:29:50 +00:00
|
|
|
|
|
|
|
/* TCP KEEPALIVE related settings */
|
2020-04-02 11:00:56 +00:00
|
|
|
int keepalive;
|
2020-07-21 18:29:50 +00:00
|
|
|
int keepalive_keep_interval;
|
|
|
|
int keepalive_probes;
|
|
|
|
int keepalive_usr_timeout;
|
|
|
|
/* */
|
2020-04-02 11:00:56 +00:00
|
|
|
int workers;
|
|
|
|
int resolvers;
|
2021-02-20 17:10:24 +00:00
|
|
|
/* client */
|
2020-04-02 11:00:56 +00:00
|
|
|
int client_max_set;
|
|
|
|
int client_max;
|
|
|
|
int client_max_routing;
|
|
|
|
int server_login_retry;
|
2021-02-25 09:00:17 +00:00
|
|
|
int reserve_session_server_connection;
|
2021-02-20 17:10:24 +00:00
|
|
|
/* */
|
2020-04-02 11:00:56 +00:00
|
|
|
int cache_coroutine;
|
|
|
|
int cache_msg_gc_size;
|
|
|
|
int coroutine_stack_size;
|
|
|
|
od_list_t listen;
|
2017-05-24 11:57:15 +00:00
|
|
|
};
|
|
|
|
|
2020-12-28 10:43:31 +00:00
|
|
|
void od_config_init(od_config_t *);
|
|
|
|
void od_config_free(od_config_t *);
|
|
|
|
void od_config_reload(od_config_t *, od_config_t *);
|
|
|
|
int od_config_validate(od_config_t *, od_logger_t *);
|
|
|
|
void od_config_print(od_config_t *, od_logger_t *);
|
2017-05-24 11:57:15 +00:00
|
|
|
|
2020-12-28 10:43:31 +00:00
|
|
|
od_config_listen_t *od_config_listen_add(od_config_t *);
|
2017-08-28 13:59:41 +00:00
|
|
|
|
2018-08-28 14:43:46 +00:00
|
|
|
#endif /* ODYSSEY_CONFIG_H */
|