Client
Object Hierarchy:
Description:
[ SimpleType ]
[ CCode ( cname = "lcb_t" , free_function = "lcb_destroy" , lower_case_cprefix = "lcb_" , unref_function = "" ) ]
public struct Client
[ CCode ( cname = "lcb_t" , free_function = "lcb_destroy" , lower_case_cprefix = "lcb_" , unref_function = "" ) ]
public struct Client
The libcouchbase client instance.
Namespace: LibCouchbase
Package: libcouchbase
Content:
Properties:
- public void* cookie { get; set; }
Alter or retrieve cookie associated with this instance.
- public string host { get; }
Get the current host
- public int is_waiting { get; }
Returns non-zero if the event loop is running now.
- public StatusResponse last_error { get; }
Returns the last error that was seen within libcouchbase.
- public int num_nodes { get; }
Get the number of the nodes in the cluster
- public int num_replicas { get; }
Get the number of the replicas in the cluster
- public string port { get; }
Get the current port
- public SyncMode sync_mode { get; set; }
Alter whether get/store commands are synchronous or asynchronous.
- public uint32 timeout { get; set; }
Set the number of usec the library should allow an operation to be valid.
- public uint32 view_timeout { get; set; }
Static methods:
- public static StatusResponse create (out Client client, ref ConnectionOptions options)
Create an instance of the Couchbase Client.
- public static unowned string get_version (uint32? version = null)
Get the version of the library.
Methods:
- public StatusResponse @get (void* command_cookie = null, GetCommand*[] commands)
Get a number of values from the cache.
- public StatusResponse @unlock (void* command_cookie = null, UnlockCommand*[] commands)
Unlock the key locked with get_locked
- public StatusResponse arithmetic (void* command_cookie = null, ArithmeticCommand*[] commands)
Perform arithmetic operation on a keys value.
- public void breakout ()
Stop event loop. Might be useful to breakout the event loop.
- public void cancel_http_request (ref HttpRequest request)
Cancel HTTP request (view or management API). This function could be called from the callback to stop the request.
- public StatusResponse connect ()
Connect to the server and get the vbucket and serverlist.
- public StatusResponse flush (void* command_cookie = null, FlushCommand*[] commands)
Flush the entire couchbase cluster!
- public void flush_buffers (void* cookie = null)
Try to send/receive data buffered on the servers.
- public unowned string? get_error (StatusResponse status)
Get a textual description for the given error code.
- public StatusResponse get_replica (void* command_cookie = null, GetReplicaCommand*[] commands)
Get a number of replica values from the cache.
- public StatusResponse make_http_request (void* command_cookie = null, HttpType type, ref HttpCommand command, ref HttpRequest request)
Execute HTTP request matching given path and yield JSON result object. Depending on type it could be:
- public StatusResponse observe (void* command_cookie = null, ObserveCommand*[] commands)
Observe key.
- public StatusResponse remove (void* command_cookie = null, RemoveCommand*[] commands)
Remove a key from the cluster
- public StatusResponse server_stats (void* command_cookie = null, ServerStatsCommand*[] commands)
Request server statistics. Without a key specified the server will respond with a "default" set of statistics information. Each piece of statistical information is returned in its own packet (key contains the name of the statistical item and the body contains the value in ASCII format). The sequence of return packets is terminated with a packet that contains no key and no value.
- public StatusResponse server_versions (void* command_cookie = null, ServerVersionCommand*[] commands = new null ?[0] {})
Request server versions. The callback will be invoked with the instance, server address, version string, and version string length.
- public void set_arithmetic_callback (ArithmeticCallback arithmetic_callback)
Set an ArithmeticCallback method.
- public void set_error_callback (ErrorCallback error_callback)
Set an ErrorCallback method.
- public void set_flush_callback (FlushCallback flush_callback)
Set a FlushCallback method.
- public void set_get_callback (GetCallback get_callback)
Set a GetCallback method.
- public void set_http_complete_callback (HttpCompleteCallback http_complete_callback)
Set an HttpCompleteCallback method.
- public void set_observe_callback (ObserveCallback observe_callback)
Set an ObserveCallback method.
- public void set_remove_callback (RemoveCallback remove_callback)
Set a RemoveCallback method.
- public void set_store_callback (StoreCallback store_callback)
Set a StoreCallback method.
- public void set_touch_callback (TouchCallback touch_callback)
Set a TouchCallback method.
- public void set_unlock_callback (UnlockCallback unlock_callback)
Set an UnlockCallback method.
- public StatusResponse set_verbosity (void* command_cookie = null, VerbosityCommand*[] commands)
Set the loglevel on the servers.
- public StatusResponse store (void* command_cookie, StoreCommand*[] commands)
Store an item in the cluster.
- public StatusResponse touch (void* command_cookie = null, TouchCommand*[] commands)
Touch (set expiration time) on a number of values in the cache.
- public StatusResponse wait ()
Wait for the execution of all batched requests.