pushcache

package
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

func GroupNameKey(groupNo string) string

GroupNameKey returns the cache key holding a group's display name.

func InvalidateGroupName

func InvalidateGroupName(rc *redis.Conn, groupNo string) error

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

func InvalidateThreadName(rc *redis.Conn, channelID string) error

InvalidateThreadName drops the cached thread display name. channelID is the thread channel ID (<groupNo>____<shortID>). See InvalidateGroupName for the best-effort contract.

func ThreadNameKey

func ThreadNameKey(channelID string) string

ThreadNameKey returns the cache key holding a thread's display name, keyed by the thread channel ID (<groupNo>____<shortID>).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL