qsldb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package qsldb is a goleveldb back-end for qsess.

Index

Constants

View Source
const DefaultPruneIntervalSecs = 2 * 60 // prune every 2 minutes

Variables

This section is empty.

Functions

func NewGldbStore

func NewGldbStore(db *leveldb.DB, prefix []byte, errLog io.Writer, cipherkeys ...[]byte) (*qsess.Store, error)

NewGldbStore creates a new session store, using a goleveldb database.

prefix will be prepended to database keys, so that a session's data can coexist with other data within the database. If the goleveldb database will not be used for anything besides session storage, and there is only a single goleveldb session store, prefix can be empty.

cipherkeys are one or more 32-byte encryption keys, to be used with AES-GCM. For encryption, only the first key is used; for decryption all keys are tried (allowing key rotation).

Additional configuration options can be set by manipulating fields in the returned qsess.Store.

NewGldbStore creates a goroutine, to prune expired sessions from the database, using an index by expiration time. You can generally ignore the pruner goroutine, but, if necessary, you can control it using two channels in the Store: PruneInterval and PruneKill.

errLog, if non-nil, enables the pruner goroutine to log unstructured error messages. No routine, "info" level messages are generated, only true errors, which should be acted on.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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