aboutsummaryrefslogtreecommitdiffstats
path: root/v3/glougloud/glougloud.h
blob: 3f59603212dd66f41dde2edb6681c207e00b91d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* glougloud internal */

#include <dnet.h>
#include <event.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

#define GLOUGLOUD_USER_DEFAULT "_glougloud"
#define GLOUGLOUD_USER_PROBES "_glougloud_probe"
#define GLOUGLOUD_USER_VIZ "_glougloud_viz"
#define GLOUGLOUD_LOGFILE "/var/log/glougloud.log"
#define GLOUGLOUD_MOD_PATH "/lib/glougloud/modules/"

struct glougloud {
	int daemonize;
	char *logfile;
	int loglevel;
	int pid;
	struct {
		char *socket;
		char *socket_chrooted;
	} redis;
	struct {
		struct addr serv_ip;
		int serv_port;
	} probes;
	struct {
		struct addr serv_ip;
		int serv_port;
	} viz;
};

/* redis.c */

int  redis_init(struct glougloud *);
void redis_shutdown(void);

redisAsyncContext *redis_connect(struct event_base *,
	void (*cb_connect)(const redisAsyncContext *, int),
	void (*cb_disconnect)(const redisAsyncContext *, int));

/* probes.c */

int  probes_init(struct glougloud *);
void probes_shutdown(void);

/* viz.c */

int  viz_init(struct glougloud *);
void viz_shutdown(void);