Documentation
¶
Overview ¶
Package pushcache centralizes the Redis cache-key scheme for offline push notification titles (group name / thread name) and the invalidation helpers that keep those caches fresh when the underlying name changes.
The offline-push pipeline (modules/webhook) reads these display names through a TTL cache to avoid a database hit on every offline message. Because the modules/webhook package imports modules/group, the group/thread packages cannot import webhook to bust the cache on rename without creating an import cycle. This package is the neutral, lower-level home that both the producer (webhook, which builds the keys) and the writers (group/thread, which invalidate on rename) can depend on, so the key format lives in exactly one place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupNameKey ¶
GroupNameKey returns the cache key holding a group's display name.
func InvalidateGroupName ¶
InvalidateGroupName drops the cached group display name so the next offline push re-reads it from the database. Call it after a group rename. It is best-effort: callers should log but not fail their operation on error — the cache TTL is the backstop.
func InvalidateThreadName ¶
InvalidateThreadName drops the cached thread display name. channelID is the thread channel ID (<groupNo>____<shortID>). See InvalidateGroupName for the best-effort contract.
func ThreadNameKey ¶
ThreadNameKey returns the cache key holding a thread's display name, keyed by the thread channel ID (<groupNo>____<shortID>).
Types ¶
This section is empty.