2016-11-07 10:59:09 +00:00
|
|
|
#ifndef OD_SCHEME_H_
|
|
|
|
#define OD_SCHEME_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* odissey - PostgreSQL connection pooler and
|
|
|
|
* request router.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct odscheme_server_t odscheme_server_t;
|
|
|
|
typedef struct odscheme_route_t odscheme_route_t;
|
|
|
|
typedef struct odscheme_t odscheme_t;
|
|
|
|
|
|
|
|
struct odscheme_server_t {
|
2016-11-07 12:59:29 +00:00
|
|
|
char *name;
|
|
|
|
char *host;
|
|
|
|
int port;
|
|
|
|
int is_default;
|
|
|
|
odlist_t link;
|
2016-11-07 10:59:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct odscheme_route_t {
|
2016-11-07 12:59:29 +00:00
|
|
|
char *database;
|
|
|
|
char *user;
|
|
|
|
char *password;
|
|
|
|
int client_max;
|
|
|
|
int pool_min;
|
|
|
|
int pool_max;
|
|
|
|
odlist_t link;
|
2016-11-07 10:59:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct odscheme_t {
|
2016-11-07 12:06:49 +00:00
|
|
|
char *config_file;
|
2016-11-07 10:59:09 +00:00
|
|
|
/* main */
|
|
|
|
int daemonize;
|
|
|
|
char *log_file;
|
|
|
|
char *pid_file;
|
|
|
|
char *pooling;
|
|
|
|
/* listen */
|
|
|
|
char *host;
|
|
|
|
int port;
|
|
|
|
int workers;
|
2016-11-07 12:06:49 +00:00
|
|
|
int client_max;
|
2016-11-07 10:59:09 +00:00
|
|
|
/* servers */
|
|
|
|
odlist_t servers;
|
|
|
|
/* routing */
|
|
|
|
char *routing;
|
|
|
|
odlist_t routing_table;
|
|
|
|
};
|
|
|
|
|
|
|
|
void od_schemeinit(odscheme_t*);
|
|
|
|
void od_schemefree(odscheme_t*);
|
|
|
|
|
2016-11-07 12:59:29 +00:00
|
|
|
odscheme_server_t*
|
|
|
|
od_scheme_addserver(odscheme_t*);
|
|
|
|
|
|
|
|
odscheme_route_t*
|
|
|
|
od_scheme_addroute(odscheme_t*);
|
|
|
|
|
2016-11-07 10:59:09 +00:00
|
|
|
#endif
|