Documentation
¶
Overview ¶
Package redisstore provides a store.KV session backend built on the native celeris driver/redis client. Sessions are persisted as JSON payloads under a configurable key prefix (default "sess:").
The returned store also implements store.Scanner and store.PrefixDeleter via SCAN + DEL, which the session middleware uses for Reset operations.
Index ¶
- type Options
- type Store
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) DeletePrefix(ctx context.Context, prefix string) error
- func (s *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (s *Store) Scan(ctx context.Context, prefix string) ([]string, error)
- func (s *Store) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
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 when reading/writing
// Redis. Default: "sess:".
KeyPrefix string
// ScanCount is the COUNT hint passed to SCAN on Reset/DeletePrefix
// iterations. Default: 100.
ScanCount int64
}
Options configure the Redis-backed session store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a store.KV backed by a *redis.Client. It also satisfies store.Scanner and store.PrefixDeleter.
func (*Store) DeletePrefix ¶
DeletePrefix implements store.PrefixDeleter via SCAN + DEL pipelines.
func (*Store) Scan ¶
Scan implements store.Scanner.
Click to show internal directories.
Click to hide internal directories.