MXS-1220: Add JSON return value to diagnostics entry points

The modules that implement a diagnostics entry point now return a JSON
type object. This removes the need to format data inside the modules.

The module implementations of these are not yet complete which means that
MaxScale will fail to compile.
This commit is contained in:
Markus Mäkelä
2017-04-18 04:56:37 +03:00
committed by Markus Mäkelä
parent 94ebef0703
commit bbe0620944
8 changed files with 113 additions and 21 deletions

View File

@ -21,6 +21,7 @@
#include <maxscale/cdefs.h>
#include <maxscale/buffer.h>
#include <maxscale/jansson.h>
MXS_BEGIN_DECLS
@ -81,7 +82,20 @@ typedef struct mxs_authenticator
void (*free)(struct dcb *);
void (*destroy)(void *);
int (*loadusers)(struct servlistener *);
void (*diagnostic)(struct dcb*, struct servlistener *);
/**
* @brief Return diagnostic information about the authenticator
*
* The authenticator module should return information about its internal
* state when this function is called.
*
* @params Listener object
*
* @return JSON representation of the listener
*
* @see jansson.h
*/
json_t* (*diagnostic)(struct servlistener *listener);
/** This entry point was added to avoid calling authenticator functions
* directly when a COM_CHANGE_USER command is executed. */