Documentation
¶
Overview ¶
Package memcachedstore provides a store.KV session backend built on the native celeris driver/memcached client. A drop-in rival to the Redis-backed middleware/session/redisstore for deployments that prefer memcached.
Memcached has no key-enumeration protocol (no SCAN), so the returned store implements store.KV only — not store.Scanner or store.PrefixDeleter. The session middleware's Reset path becomes a documented no-op with memcached; callers who need bulk-expiry can call [memcached.Client.Flush] directly or shard sessions across a short-lived prefix they retire by rotating the prefix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// KeyPrefix is prepended to every session id. Memcached keys must
// be 1..250 bytes with no whitespace/control bytes, so callers
// should pick a short prefix. Default: "sess:".
KeyPrefix string
}
Options configure the memcached-backed session store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a store.KV backed by a *celmc.Client.
func (*Store) Delete ¶
Delete implements store.KV. Memcached's DELETE returns ErrCacheMiss when the key is absent; we treat that as a successful no-op to match the store.KV contract ("Delete returning nil means the key is not present regardless of whether it was present before the call").