redisstore

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package redisstore implements the scs.Store interface on top of Redis. It exists (rather than using scs's own redisstore) so the keys carry the cms_session: prefix and can live in a Redis instance shared with the host application, mirroring what sessionstore does for the cms_sessions table.

Redis expires keys itself, so unlike sessionstore there is no background cleanup goroutine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store persists sessions in Redis under cms_session: keys.

func New

func New(client redis.UniversalClient) *Store

New returns a Store backed by client.

func (*Store) Commit

func (s *Store) Commit(token string, data []byte, expiry time.Time) error

Commit inserts or updates a session token with data, expiring at expiry.

func (*Store) Delete

func (s *Store) Delete(token string) error

Delete removes a session token. Deleting an absent token is not an error.

func (*Store) Find

func (s *Store) Find(token string) ([]byte, bool, error)

Find returns the data for a session token, if present and unexpired.

Jump to

Keyboard shortcuts

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