MEMCACHED_DUMP(3)
π MEMCACHED_DUMP π
okay bestie so we're cracking open memcached_dump(3) from the libmemcached-awesome manual, and it's literally the libmemcached documentation, no cap. sit down, grab a strawberry, we're doing this π
β¨ NAME β¨
memcached_dump β libmemcached Documentation π
πΈ SYNOPSIS πΈ
first things first, you gotta pull the header in and link the lib:
#include <libmemcached/memcached.h>
and compile + link with -lmemcached π
then here's the callback type you're signing up for:
typedef memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context)
she takes four params and i need you to know each one fr:
- Param
ptrβ pointer tomemcached_stobject - Param
keyβ the key string being dumped - Param
key_lengthβ length of the key, and no terminating zero included, don't play yourself - Param
contextβ pointer to the user supplied context - Returns β
memcached_return_tindicating success β
and the main character herself:
memcached_return_t memcached_dump(memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
π Parameters π
ptrβ pointer to initializedmemcached_ststructfunctionβ pointer tonumber_of_callbacksmemcached_dump_fncallbackscontextβ pointer to a user managed contextnumber_of_callbacksβ number of callbacks in thefunctionarray
π«Ά Returns π«Ά
memcached_return_t indicating success π
π¦ DESCRIPTION π¦
so memcached_dump() is the girl that goes and gets you a list of keys living on memcached(1) servers β¨
BUT β and this is important, bestie, listen β because memcached does not guarantee to dump all keys, you literally cannot assume you have fetched all keys from the server. like, ever. it's giving "here's what i felt like handing you" π
the way it works is you hand her an array of callbacks, and she'll run those callbacks on keys as she finds them. that's the whole vibe.
ngl there's a little asterisk here: currently the binary protocol is not tested. so. yeah. just so you know going in π
π RETURN VALUE π
you get back a value of type memcached_return_t. on success that value will be MEMCACHED_SUCCESS. and if you wanna turn that value into something a human can read, use memcached_strerror(). periodt. π
π SEE ALSO π
okay that's the whole page, you ate that π this was libmemcached-awesome version 1.1, dated Jul 24, 2025 β go forth and dump those keys, queen πβ¨π¦
π¦ where this page comes from
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms