4#ifndef PROTOCORE_EDGE_CACHE_PROXY_H
5#define PROTOCORE_EDGE_CACHE_PROXY_H
37 embed_bool (*
map)(uint8_t *,
const char *,
const char *);
38 void (*
bind_sd)(uint8_t *,
struct protocore_dbm *);
39 embed_bool (*
add_peer)(uint8_t *,
const char *, uint16_t);
42 embed_bool (*
purge)(uint8_t *,
const char *);
44 void (*
stats)(uint8_t *,
struct EdgeCacheStats *);
uint32_t protocore_edge_proxy_purge_prefix(uint8_t *work, const char *path_prefix)
Invalidate every entry whose request path begins with prefix. the .
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.
void protocore_edge_proxy_reset(uint8_t *work)
Clear the L1 store, the L2 store (if bound), all route maps, and .
embed_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 .
embed_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_mesh_serve(uint8_t *work)
Serve sibling queries: register the PROTO_MESH handler so this node .
embed_bool protocore_edge_proxy_purge(uint8_t *work, const char *canonical_key)
Invalidate a single canonical key. true if an entry was purged.
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#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(* stats)(uint8_t *, struct EdgeCacheStats *)
void(* enable)(uint8_t *)
void(* mesh_serve)(uint8_t *)
embed_bool(* purge)(uint8_t *, const char *)
embed_bool(* map)(uint8_t *, const char *, const char *)
void(* bind_sd)(uint8_t *, struct protocore_dbm *)
uint32_t(* purge_prefix)(uint8_t *, const char *)
embed_bool(* add_peer)(uint8_t *, const char *, uint16_t)