Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Options used to open the leveldb database, defaults to leveldb's default values. Options = &opt.Options{} // WriteOptions used to put and delete, defaults to leveldb's default values. WriteOptions = &opt.WriteOptions{} // ReadOptions used to iterate over the database, defaults to leveldb's default values. ReadOptions = &opt.ReadOptions{} )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { // Service is the underline LevelDB database connection, // it's initialized at `New` or `NewFromDB`. // Can be used to get stats. Service *leveldb.DB // contains filtered or unexported fields }
Database the LevelDB(file-based) session storage.
func New ¶
New creates and returns a new LevelDB(file-based) storage instance based on the "directoryPath". DirectoryPath should is the directory which the leveldb database will store the sessions, i.e ./sessions/
It will remove any old session files.
func NewFromDB ¶
NewFromDB same as `New` but accepts an already-created custom leveldb connection instead.
func (*Database) Async ¶
Async if true passed then it will use different go routines to update the LevelDB(file-based) storage.
func (*Database) Cleanup ¶
Cleanup removes any invalid(have expired) session entries, it's being called automatically on `New` as well.
Click to show internal directories.
Click to hide internal directories.