Skip to content

Commit

Permalink
public api
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigzagAK committed Jan 3, 2019
1 parent 39819a4 commit a04742d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ HTTP_ZOOKEEPER_UPSTREAM_SRCS="$ngx_addon_dir/ngx_zookeeper_upstream_module.c"
ZOO_REQUIRED_INCS="$ZOO_PREFIX/include"
ZOO_REQUIRED_LIBS="-L$ZOO_PREFIX/lib -lzookeeper_mt"

CORE_INCS="$CORE_INCS $ngx_addon_dir"

if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=$ngx_addon_name
Expand Down
12 changes: 12 additions & 0 deletions ngx_zookeeper_upstream.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef _ngx_zookeeper_upstream_h_
#define _ngx_zookeeper_upstream_h_


#include <ngx_config.h>


ngx_flag_t ngx_zookeeper_upstream_connected();
int ngx_zookeeper_upstream_epoch();
void * ngx_zookeeper_upstream_handle();

#endif
22 changes: 22 additions & 0 deletions ngx_zookeeper_upstream_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


#include "ngx_dynamic_upstream_module.h"
#include "ngx_zookeeper_upstream.h"


static void *
Expand Down Expand Up @@ -246,6 +247,27 @@ static zookeeper_t zoo = {
};


ngx_flag_t
ngx_zookeeper_upstream_connected()
{
return zoo.connected;
}


int
ngx_zookeeper_upstream_epoch()
{
return zoo.epoch;
}


void *
ngx_zookeeper_upstream_handle()
{
return zoo.handle;
}


static void
ngx_log_message(const char *s)
{
Expand Down

0 comments on commit a04742d

Please sign in to comment.