|
Csilk 0.2.1
A lightweight, high-performance C HTTP web framework
|
Pluggable storage driver for context key-value pairs. More...
#include <csilk.h>
Data Fields | |
| void(* | set )(csilk_ctx_t *c, const char *key, void *value) |
Store a value associated with key. | |
| void *(* | get )(csilk_ctx_t *c, const char *key) |
| Retrieve a value by key. | |
| void(* | clear )(csilk_ctx_t *c) |
| Clear all stored key-value pairs. Called during csilk_ctx_cleanup to release references. | |
Pluggable storage driver for context key-value pairs.
Allows users to replace the default in-memory arena-backed store with a custom backend (e.g., a thread-local or external cache). Every function receives the owning csilk_ctx_t so drivers can access per-request state.
| void(* csilk_storage_driver_t::clear)(csilk_ctx_t *c) |
Clear all stored key-value pairs. Called during csilk_ctx_cleanup to release references.
| void *(* csilk_storage_driver_t::get)(csilk_ctx_t *c, const char *key) |
Retrieve a value by key.
| c | Owning request context. |
| key | NUL-terminated key string. |
key was never set. | void(* csilk_storage_driver_t::set)(csilk_ctx_t *c, const char *key, void *value) |
Store a value associated with key.
| c | Owning request context. |
| key | NUL-terminated key string (copied internally). |
| value | Opaque pointer to store. Ownership remains with caller. |