Documentation
¶
Index ¶
- func NewSessionStorage(logger *slog.Logger, settings model.RedisDatabaseSettings) (model.SessionStorage, error)
- type RedisSessionStorage
- func (r *RedisSessionStorage) Close()
- func (r *RedisSessionStorage) DeleteSession(id string) error
- func (r *RedisSessionStorage) GetSession(id string) (model.Session, error)
- func (r *RedisSessionStorage) InsertSession(session model.Session) error
- func (r *RedisSessionStorage) ProlongSession(id string, newDuration model.SessionDuration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSessionStorage ¶
func NewSessionStorage( logger *slog.Logger, settings model.RedisDatabaseSettings, ) (model.SessionStorage, error)
NewSessionStorage creates new Redis session storage.
Types ¶
type RedisSessionStorage ¶
type RedisSessionStorage struct {
// contains filtered or unexported fields
}
RedisSessionStorage is a Redis-backed storage for admin sessions.
func (*RedisSessionStorage) Close ¶ added in v2.2.14
func (r *RedisSessionStorage) Close()
func (*RedisSessionStorage) DeleteSession ¶
func (r *RedisSessionStorage) DeleteSession(id string) error
DeleteSession deletes session from the storage.
func (*RedisSessionStorage) GetSession ¶
func (r *RedisSessionStorage) GetSession(id string) (model.Session, error)
GetSession fetches session by ID.
func (*RedisSessionStorage) InsertSession ¶
func (r *RedisSessionStorage) InsertSession(session model.Session) error
InsertSession inserts session to the storage.
func (*RedisSessionStorage) ProlongSession ¶
func (r *RedisSessionStorage) ProlongSession(id string, newDuration model.SessionDuration) error
ProlongSession sets new duration for the existing session.
Click to show internal directories.
Click to hide internal directories.