Use common constants for monitor and server parameters
The parameter names for monitors and servers now use a set of constant names. This removes some of the errors caused by spelling mistakes when the same parameter name is repeated in multiple places. The service, filter and listener parameters should also be converted to constants. This allows for a consistent user experience.
This commit is contained in:
committed by
Markus Mäkelä
parent
9aa4138705
commit
695a4032ca
@ -33,6 +33,30 @@ MXS_BEGIN_DECLS
|
||||
#define MAX_ADMIN_USER_LEN 1024
|
||||
#define MAX_ADMIN_PW_LEN 1024
|
||||
|
||||
/**
|
||||
* Common configuration parameters names
|
||||
*/
|
||||
extern const char CN_PASSWORD[];
|
||||
extern const char CN_USER[];
|
||||
extern const char CN_ADDRESS[];
|
||||
extern const char CN_NAME[];
|
||||
extern const char CN_PORT[];
|
||||
extern const char CN_MODULE[];
|
||||
extern const char CN_TYPE[];
|
||||
extern const char CN_PROTOCOL[];
|
||||
extern const char CN_DEFAULT[];
|
||||
extern const char CN_SERVERS[];
|
||||
|
||||
extern const char CN_SSL[];
|
||||
extern const char CN_SSL_KEY[];
|
||||
extern const char CN_SSL_CERT[];
|
||||
extern const char CN_SSL_CA_CERT[];
|
||||
extern const char CN_SSL_VERSION[];
|
||||
extern const char CN_SSL_CERT_VERIFY_DEPTH[];
|
||||
|
||||
extern const char CN_AUTHENTICATOR[];
|
||||
extern const char CN_AUTHENTICATOR_OPTIONS[];
|
||||
|
||||
/**
|
||||
* The config parameter
|
||||
*/
|
||||
@ -310,6 +334,4 @@ void config_disable_feedback_task(void);
|
||||
*/
|
||||
bool config_reload(void);
|
||||
|
||||
static const char BACKEND_CONNECT_ATTEMPTS[] = "backend_connect_attempts";
|
||||
|
||||
MXS_END_DECLS
|
||||
|
||||
@ -237,6 +237,17 @@ static const char MXS_MONITOR_EVENT_DEFAULT_VALUE[] = "master_down,master_up,sla
|
||||
"ndb_down,ndb_up,lost_master,lost_slave,lost_synced,lost_donor,lost_ndb,"
|
||||
"new_master,new_slave,new_synced,new_donor,new_ndb";
|
||||
|
||||
/**
|
||||
* Monitor configuration parameters names
|
||||
*/
|
||||
extern const char CN_BACKEND_CONNECT_ATTEMPTS[];
|
||||
extern const char CN_BACKEND_READ_TIMEOUT[];
|
||||
extern const char CN_BACKEND_WRITE_TIMEOUT[];
|
||||
extern const char CN_BACKEND_CONNECT_TIMEOUT[];
|
||||
extern const char CN_MONITOR_INTERVAL[];
|
||||
extern const char CN_SCRIPT[];
|
||||
extern const char CN_EVENTS[];
|
||||
|
||||
bool check_monitor_permissions(MXS_MONITOR* monitor, const char* query);
|
||||
|
||||
void monitor_clear_pending_status(MXS_MONITOR_SERVERS *ptr, int bit);
|
||||
|
||||
@ -30,6 +30,15 @@ MXS_BEGIN_DECLS
|
||||
#define MAX_SERVER_MONPW_LEN 512
|
||||
#define MAX_NUM_SLAVES 128 /**< Maximum number of slaves under a single server*/
|
||||
|
||||
/**
|
||||
* Server configuration parameters names
|
||||
*/
|
||||
extern const char CN_MONITORPW[];
|
||||
extern const char CN_MONITORUSER[];
|
||||
extern const char CN_PERSISTMAXTIME[];
|
||||
extern const char CN_PERSISTPOOLMAX[];
|
||||
extern const char CN_USE_PROXY_PROTOCOL[];
|
||||
|
||||
/**
|
||||
* The server parameters used for weighting routing decissions
|
||||
*/
|
||||
@ -192,8 +201,6 @@ enum
|
||||
(((server)->status & (SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE|SERVER_MAINT)) == \
|
||||
(SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE))
|
||||
|
||||
extern const char USE_PROXY_PROTOCOL[];
|
||||
|
||||
/**
|
||||
* @brief Allocate a new server
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user