redis

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisSessionService

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

RedisSessionService implements session.Service using Redis as the backend.

func NewRedisSessionService

func NewRedisSessionService(cfg RedisSessionServiceConfig) (*RedisSessionService, error)

NewRedisSessionService creates a new Redis-backed session service.

func (*RedisSessionService) AppendEvent

func (s *RedisSessionService) AppendEvent(ctx context.Context, sess session.Session, evt *session.Event) error

AppendEvent appends an event to a session.

func (*RedisSessionService) Close

func (s *RedisSessionService) Close() error

Close closes the Redis connection.

func (*RedisSessionService) Create

Create creates a new session.

func (*RedisSessionService) Delete

Delete removes a session.

func (*RedisSessionService) Get

Get retrieves a session by ID.

func (*RedisSessionService) List

List returns all sessions for a user.

type RedisSessionServiceConfig

type RedisSessionServiceConfig struct {
	// Addr is the Redis server address (e.g., "localhost:6379")
	Addr string
	// Password for Redis authentication (optional)
	Password string
	// DB is the Redis database number
	DB int
	// TTL is the session expiration time (default: 24 hours)
	TTL time.Duration
}

RedisSessionServiceConfig holds configuration for RedisSessionService.

Jump to

Keyboard shortcuts

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