All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
couchbase.h File Reference

Couchbase wrapper function prototypes and datatypes. More...

#include <libcouchbase/couchbase.h>
#include "../rlm_json/json.h"
+ Include dependency graph for couchbase.h:
+ This graph shows which files directly or indirectly include this file:

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...
 

Typedefs

typedef struct cookie_t cookie_t
 Information relating to the parsing of Couchbase document payloads. More...
 
typedef union cookie_u cookie_u
 Union of constant and non-constant pointers. 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 *pass, lcb_uint32_t timeout)
 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...
 

Detailed Description

Couchbase wrapper function prototypes and datatypes.

Id:
930487f21af58229b2d95807d9411048f9409f8e
Author
Aaron Hurt ahurt.nosp@m.@anb.nosp@m.cs.co.nosp@m.m

Definition in file couchbase.h.


Data Structure Documentation

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 40 of file couchbase.h.

Data Fields
enum json_tokener_error jerr Error values produced by the json-c library.
json_object * jobj JSON objects handled by the json-c library.
json_tokener * jtok JSON tokener objects handled by the json-c library.
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 51 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).

Typedef Documentation

typedef struct cookie_t 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.

typedef union cookie_u 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.

Function Documentation

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
errorCouchbase error object.
respCouchbase get operation response object.

Definition at line 82 of file couchbase.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
keyDocument key to fetch.
Returns
Couchbase error object.

Definition at line 318 of file couchbase.c.

+ Here is the caller graph for this function:

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.

Parameters
requestCouchbase http request object.
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
errorCouchbase error object.
respCouchbase http response object.

Definition at line 139 of file couchbase.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lcb_error_t couchbase_init_connection ( lcb_t *  instance,
const char *  host,
const char *  bucket,
const char *  pass,
lcb_uint32_t  timeout 
)

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.

Parameters
instanceEmpty (un-allocated) Couchbase instance object.
hostThe Couchbase server or list of servers.
bucketThe Couchbase bucket to associate with the instance.
passThe Couchbase bucket password (NULL if none).
timeoutMaximum time to wait for obtaining the initial configuration.
Returns
Couchbase error object.

Definition at line 198 of file couchbase.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
pathThe fully qualified view path including the design document and view name.
postThe post payload (NULL for none).
Returns
Couchbase error object.

Definition at line 370 of file couchbase.c.

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
Returns
Couchbase error object.

Definition at line 247 of file couchbase.c.

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
keyDocument key to store in the database.
documentDocument body to store in the database.
expireExpiration time for the document (0 = never)
Returns
Couchbase error object.

Definition at line 281 of file couchbase.c.

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
errorCouchbase error object.
respCouchbase statistics response object.

Definition at line 43 of file couchbase.c.

+ Here is the caller graph for this function:

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.

Parameters
instanceCouchbase connection instance.
cookieCouchbase cookie for returning information from callbacks.
operationCouchbase storage operation object.
errorCouchbase error object.
respCouchbase store operation response object.

Definition at line 62 of file couchbase.c.

+ Here is the caller graph for this function: