Documentation
¶
Overview ¶
Package sessionbolt provides a Redis store for sessions.
This package is only compatible with https://github.com/go-redis/redis. But since this package has several different versions for different versions of Redis, we do not import any of them, but ensure compatibility with any of them through generics.
How to use? ¶
- go get and import relavant go-redis module
- go get and import this module
- define store
Example:
import ( "github.com/go-redis/redis/v9" // or "github.com/go-redis/redis/v8" "github.com/mr-linch/go-tg/tgb/session/sessionredis" ) func run(ctx context.Context) error { opts, err := redis.ParseURL("redis://localhost:6379") if err != nil { return err } client := redis.NewClient(opts) store := sessionredis.NewStore[*redis.StatusCmd, *redis.StringCmd, *redis.IntCmd](client) // use store :) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.