cache

package
v0.0.0-...-040f366 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, key string) (string, error)

Get retrieves a string value by key. Returns redis.Nil error if key does not exist.

func GetClient

func GetClient() *redis.Client

GetClient returns the global Redis client.

func InitRedis

func InitRedis(addr, password string, db int)

InitRedis initializes the global Redis client. Call this once (e.g. in cmd/feedjson/main.go) before using Get/Set or RDB.

func RDB

func RDB() *redis.Client

RDB returns the underlying Redis client for direct use (e.g. in auth/store.go or advanced operations).

func Set

func Set(ctx context.Context, key, val string, ttl time.Duration) error

Set stores a string value with the given TTL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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