4#ifndef PROTOCORE_EDGE_CACHE_PROXY_H
5#define PROTOCORE_EDGE_CACHE_PROXY_H
36 void (*enable)(uint8_t *);
37 proto_bool (*map)(uint8_t *,
const char *,
const char *);
38 void (*bind_sd)(uint8_t *,
struct protocore_dbm *);
39 proto_bool (*add_peer)(uint8_t *,
const char *, uint16_t);
40 void (*mesh_serve)(uint8_t *);
41 void (*reset)(uint8_t *);
43 uint32_t (*purge_prefix)(uint8_t *,
const char *);
44 void (*stats)(uint8_t *,
struct EdgeCacheStats *);
proto_bool protocore_edge_proxy_purge(uint8_t *work, const char *canonical_key)
Invalidate a single canonical key. true if an entry was purged.
uint32_t protocore_edge_proxy_purge_prefix(uint8_t *work, const char *path_prefix)
Invalidate every entry whose request path begins with prefix. the .
PROTOCORE_NS EdgeProxyNs EdgeProxy PROTOCORE_UNUSED
Module namespace.
void protocore_edge_proxy_bind_sd(uint8_t *work, struct protocore_dbm *dbm)
Bind an L2 persistent tier: an opened dbm handle (on a mounted WAL .
void protocore_edge_proxy_stats(uint8_t *work, struct EdgeCacheStats *out)
Snapshot the cache counters.
void protocore_edge_proxy_enable(uint8_t *work)
Enable the edge cache on server: register the cache middleware + .
uint8_t * protocore_edge_cache_proxy_span(void)
The PROTOCORE_EDGE_PROXY_BORROW bytes this module's state lives in.
proto_bool protocore_edge_proxy_map(uint8_t *work, const char *path_prefix, const char *origin_base_url)
Map a request path prefix to an upstream origin (e.g. "/cdn/" -> .
void protocore_edge_proxy_reset(uint8_t *work)
Clear the L1 store, the L2 store (if bound), all route maps, and .
void protocore_edge_proxy_mesh_serve(uint8_t *work)
Serve sibling queries: register the PROTO_MESH handler so this node .
proto_bool protocore_edge_proxy_add_peer(uint8_t *work, const char *host, uint16_t port)
Add a sibling peer to query on a full local miss before hitting the .
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
void(* enable)(uint8_t *)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS