libwebsockets
Lightweight C library for HTML5 websockets
lws_cache_ops Struct Reference

#include <lws-cache-ttl.h>

+ Collaboration diagram for lws_cache_ops:

Data Fields

struct lws_cache_ttl_lru *(* create )(const struct lws_cache_creation_info *info)
 
void(* destroy )(struct lws_cache_ttl_lru **_cache)
 
int(* expunge )(struct lws_cache_ttl_lru *cache)
 
int(* write )(struct lws_cache_ttl_lru *cache, const char *specific_key, const uint8_t *source, size_t size, lws_usec_t expiry, void **ppvoid)
 
int(* tag_match )(struct lws_cache_ttl_lru *cache, const char *wc, const char *tag, char lookup_rules)
 
int(* lookup )(struct lws_cache_ttl_lru *cache, const char *wildcard_key, lws_dll2_owner_t *results_owner)
 
int(* invalidate )(struct lws_cache_ttl_lru *cache, const char *wildcard_key)
 
int(* get )(struct lws_cache_ttl_lru *cache, const char *specific_key, const void **pdata, size_t *psize)
 
void(* debug_dump )(struct lws_cache_ttl_lru *cache)
 

Detailed Description

Definition at line 253 of file lws-cache-ttl.h.

Field Documentation

◆ create

struct lws_cache_ttl_lru*(* lws_cache_ops::create) (const struct lws_cache_creation_info *info)

create an instance of the cache type specified in info

Definition at line 235 of file lws-cache-ttl.h.

◆ destroy

void(* lws_cache_ops::destroy) (struct lws_cache_ttl_lru **_cache)

destroy the logical cache instance pointed to by *_cache, doesn't affect any NV backing storage

Definition at line 258 of file lws-cache-ttl.h.

◆ expunge

int(* lws_cache_ops::expunge) (struct lws_cache_ttl_lru *cache)

completely delete any backing storage related to the cache instance, eg, delete the backing file

Definition at line 263 of file lws-cache-ttl.h.

◆ write

int(* lws_cache_ops::write) (struct lws_cache_ttl_lru *cache, const char *specific_key, const uint8_t *source, size_t size, lws_usec_t expiry, void **ppvoid)

create an entry in the cache level according to the given info

Definition at line 268 of file lws-cache-ttl.h.

◆ tag_match

int(* lws_cache_ops::tag_match) (struct lws_cache_ttl_lru *cache, const char *wc, const char *tag, char lookup_rules)

Just tell us if tag would match wildcard, using whatever special rules the backing store might use for tag matching. 0 indicates it is a match on wildcard, nonzero means does not match.

Definition at line 273 of file lws-cache-ttl.h.

◆ lookup

int(* lws_cache_ops::lookup) (struct lws_cache_ttl_lru *cache, const char *wildcard_key, lws_dll2_owner_t *results_owner)

Definition at line 280 of file lws-cache-ttl.h.

◆ invalidate

int(* lws_cache_ops::invalidate) (struct lws_cache_ttl_lru *cache, const char *wildcard_key)
  • add keys for search_key matches not already listed in the results owner remove matching item(s) from cache level

Definition at line 285 of file lws-cache-ttl.h.

◆ get

int(* lws_cache_ops::get) (struct lws_cache_ttl_lru *cache, const char *specific_key, const void **pdata, size_t *psize)

if it has the item, fills L1 with item. updates LRU, and returns pointer to payload in L1

Definition at line 289 of file lws-cache-ttl.h.

◆ debug_dump

void(* lws_cache_ops::debug_dump) (struct lws_cache_ttl_lru *cache)

Helper to dump the whole cache contents to log, useful for debug

Definition at line 295 of file lws-cache-ttl.h.


The documentation for this struct was generated from the following file: