The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Couchbase wrapper function prototypes and datatypes. More...
#include <libcouchbase/couchbase.h>
#include <freeradius-devel/json/base.h>
Go to the source code of this file.
Data Structures | |
struct | cookie_t |
Information relating to the parsing of Couchbase document payloads. More... | |
union | cookie_u |
Union of constant and non-constant pointers. More... | |
struct | couchbase_opts_s |
Typedefs | |
typedef union cookie_u | cookie_u |
Union of constant and non-constant pointers. More... | |
typedef struct couchbase_opts_s | couchbase_opts_t |
This may be used to provide a simple interface from a command line or higher evel language to allow the setting of specific key-value pairs. More... | |
Functions | |
void | couchbase_get_callback (lcb_t instance, const void *cookie, lcb_error_t error, const lcb_get_resp_t *item) |
Couchbase callback for get (read) operations. More... | |
lcb_error_t | couchbase_get_key (lcb_t instance, const void *cookie, const char *key) |
Retrieve a document by key from Couchbase. More... | |
void | couchbase_http_data_callback (lcb_http_request_t request, lcb_t instance, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp) |
Couchbase callback for http (view) operations. More... | |
lcb_error_t | couchbase_init_connection (lcb_t *instance, const char *host, const char *bucket, const char *user, const char *pass, lcb_uint32_t timeout, const couchbase_opts_t *opts) |
Initialize a Couchbase connection instance. More... | |
lcb_error_t | couchbase_query_view (lcb_t instance, const void *cookie, const char *path, const char *post) |
Query a Couchbase design document view. More... | |
lcb_error_t | couchbase_server_stats (lcb_t instance, const void *cookie) |
Request Couchbase server statistics. More... | |
lcb_error_t | couchbase_set_key (lcb_t instance, const char *key, const char *document, int expire) |
Store a document by key in Couchbase. More... | |
void | couchbase_stat_callback (lcb_t instance, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp) |
Couchbase callback for cluster statistics requests. More... | |
void | couchbase_store_callback (lcb_t instance, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *item) |
Couchbase callback for store (write) operations. More... | |
Variables | |
HIDDEN fr_dict_attr_t const * | attr_acct_session_time |
HIDDEN fr_dict_attr_t const * | attr_acct_status_type |
HIDDEN fr_dict_attr_t const * | attr_event_timestamp |
Couchbase wrapper function prototypes and datatypes.
Definition in file couchbase.h.
struct cookie_t |
Information relating to the parsing of Couchbase document payloads.
This structure holds various references to json-c objects used when parsing Couchbase document payloads.
Definition at line 44 of file couchbase.h.
union cookie_u |
Union of constant and non-constant pointers.
This is used to squelch compiler warnings about casting when passing data between functions expecting different data types.
Definition at line 55 of file couchbase.h.
Data Fields | ||
---|---|---|
const void * | cdata |
Constant pointer to cookie payload (cookie_t ). |
void * | data |
Non-constant pointer to data payload (cookie_t ). |
struct couchbase_opts_s |
Definition at line 67 of file couchbase.h.
Data Fields | ||
---|---|---|
char * | key | Key value for lcb_cntl_string(). |
couchbase_opts_t * | next | Linked list. |
char * | val | Value for the key used in lcb_cntl_string(). |
Union of constant and non-constant pointers.
This is used to squelch compiler warnings about casting when passing data between functions expecting different data types.
typedef struct couchbase_opts_s couchbase_opts_t |
This may be used to provide a simple interface from a command line or higher evel language to allow the setting of specific key-value pairs.
Options ref: https://docs.couchbase.com/sdk-api/couchbase-c-client-2.5.6/group__lcb-cntl.html
Definition at line 1 of file couchbase.h.
void couchbase_get_callback | ( | lcb_t | instance, |
const void * | cookie, | ||
lcb_error_t | error, | ||
const lcb_get_resp_t * | resp | ||
) |
Couchbase callback for get (read) operations.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
error | Couchbase error object. |
resp | Couchbase get operation response object. |
Definition at line 81 of file couchbase.c.
lcb_error_t couchbase_get_key | ( | lcb_t | instance, |
const void * | cookie, | ||
const char * | key | ||
) |
Retrieve a document by key from Couchbase.
Setup and execute a Couchbase get request and wait for the result.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
key | Document key to fetch. |
Definition at line 325 of file couchbase.c.
void couchbase_http_data_callback | ( | lcb_http_request_t | request, |
lcb_t | instance, | ||
const void * | cookie, | ||
lcb_error_t | error, | ||
const lcb_http_resp_t * | resp | ||
) |
Couchbase callback for http (view) operations.
request | Couchbase http request object. |
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
error | Couchbase error object. |
resp | Couchbase http response object. |
Definition at line 138 of file couchbase.c.
lcb_error_t couchbase_init_connection | ( | lcb_t * | instance, |
const char * | host, | ||
const char * | bucket, | ||
const char * | user, | ||
const char * | pass, | ||
lcb_uint32_t | timeout, | ||
const couchbase_opts_t * | opts | ||
) |
Initialize a Couchbase connection instance.
Initialize all information relating to a Couchbase instance and configure available method callbacks. This function forces synchronous operation and will wait for a connection or timeout.
instance | Empty (un-allocated) Couchbase instance object. |
host | The Couchbase server or list of servers. |
bucket | The Couchbase bucket to associate with the instance. |
user | The Couchbase bucket user (NULL if none). |
pass | The Couchbase bucket password (NULL if none). |
timeout | Maximum time to wait for obtaining the initial configuration. |
opts | Extra options to configure the libcouchbase. |
Definition at line 196 of file couchbase.c.
lcb_error_t couchbase_query_view | ( | lcb_t | instance, |
const void * | cookie, | ||
const char * | path, | ||
const char * | post | ||
) |
Query a Couchbase design document view.
Setup and execute a Couchbase view request and wait for the result.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
path | The fully qualified view path including the design document and view name. |
post | The post payload (NULL for none). |
Definition at line 377 of file couchbase.c.
lcb_error_t couchbase_server_stats | ( | lcb_t | instance, |
const void * | cookie | ||
) |
Request Couchbase server statistics.
Setup and execute a request for cluster statistics and wait for the result.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
Definition at line 254 of file couchbase.c.
lcb_error_t couchbase_set_key | ( | lcb_t | instance, |
const char * | key, | ||
const char * | document, | ||
int | expire | ||
) |
Store a document by key in Couchbase.
Setup and execute a Couchbase set operation and wait for the result.
instance | Couchbase connection instance. |
key | Document key to store in the database. |
document | Document body to store in the database. |
expire | Expiration time for the document (0 = never) |
Definition at line 288 of file couchbase.c.
void couchbase_stat_callback | ( | lcb_t | instance, |
const void * | cookie, | ||
lcb_error_t | error, | ||
const lcb_server_stat_resp_t * | resp | ||
) |
Couchbase callback for cluster statistics requests.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
error | Couchbase error object. |
resp | Couchbase statistics response object. |
Definition at line 42 of file couchbase.c.
void couchbase_store_callback | ( | lcb_t | instance, |
const void * | cookie, | ||
lcb_storage_t | operation, | ||
lcb_error_t | error, | ||
const lcb_store_resp_t * | resp | ||
) |
Couchbase callback for store (write) operations.
instance | Couchbase connection instance. |
cookie | Couchbase cookie for returning information from callbacks. |
operation | Couchbase storage operation object. |
error | Couchbase error object. |
resp | Couchbase store operation response object. |
Definition at line 61 of file couchbase.c.
|
extern |
Definition at line 77 of file rlm_couchbase.c.
|
extern |
Definition at line 76 of file rlm_couchbase.c.
|
extern |
Definition at line 78 of file rlm_couchbase.c.