fss

package module
v0.0.0-...-6c4bd0b Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 11 Imported by: 0

README

gofss

Go Filesystem Session Store

A multithreaded, optimized, ultra-performant session store that is faster, safer, and more robust than any other persistent solution available in the market today. Additionally, it saves money as storage costs continue to decline, while using minimal compute resources.

Google style sessions

The store was designed to enable year-long Google-style sessions with configurable high-level cryptography.

Benchmark
$ go test -bench=. -benchmem

goos: linux
goarch: amd64
pkg: github.com/divilla/gofss
cpu: 13th Gen Intel(R) Core(TM) i7-13650HX

BenchmarkSessionCreate-20        87756      11413 ns/op        5600 B/op      115 allocs/op
BenchmarkSessionRead-20        1426465        941.8 ns/op      1331 B/op        8 allocs/op
BenchmarkSessionUpdate-20       123658      14473 ns/op         500 B/op        6 allocs/op
BenchmarkSessionDelete-20        56817      17765 ns/op         393 B/op        4 allocs/op

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	URL64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
)

Functions

This section is empty.

Types

type SessionStore

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

func NewSessionStore

func NewSessionStore(cfg SessionStoreConfig) (*SessionStore, error)

func (*SessionStore) Create

func (a *SessionStore) Create(data []byte) string

func (*SessionStore) Delete

func (a *SessionStore) Delete(id string) error

func (*SessionStore) Purge

func (a *SessionStore) Purge() error

func (*SessionStore) Read

func (a *SessionStore) Read(id string) ([]byte, error)

func (*SessionStore) Reset

func (a *SessionStore) Reset(id string) (string, error)

func (*SessionStore) SID

func (a *SessionStore) SID() string

func (*SessionStore) Timestamp

func (a *SessionStore) Timestamp(id string) (*time.Time, error)

func (*SessionStore) Write

func (a *SessionStore) Write(id string, data []byte) error

type SessionStoreConfig

type SessionStoreConfig struct {
	SavePath       string
	CryptoStrength int
	ExpireInterval time.Duration
	PurgeInterval  time.Duration
}

func NewSessionStoreConfig

func NewSessionStoreConfig() SessionStoreConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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