session

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package session provides HTTP session management for the Lemmego framework.

It wraps the scs (Session Cookie Store) library to provide session functionality with support for multiple storage backends including memory, file, and Redis. The session system handles secure cookie management and session data persistence.

Index

Constants

View Source
const (
	// DriverMemory uses in-memory storage (not recommended for production)
	DriverMemory = "memory"
	// DriverFile uses file-based storage for session data
	DriverFile = "file"
	// DriverRedis uses Redis for session storage
	DriverRedis = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

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

func NewFileSession

func NewFileSession(directoryPath string) *FileStore

func (*FileStore) Commit

func (fs *FileStore) Commit(token string, b []byte, expiry time.Time) error

func (*FileStore) Delete

func (fs *FileStore) Delete(token string) error

func (*FileStore) Find

func (fs *FileStore) Find(token string) ([]byte, bool, error)

type Session

type Session struct {
	*scs.SessionManager
}

Session wraps the scs.SessionManager to provide session functionality. It manages session lifecycle, cookie handling, and data persistence.

func New added in v0.1.3

func New(store scs.Store, cookie scs.SessionCookie) *Session

Jump to

Keyboard shortcuts

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