Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dchest/gorilla-fsgc

Package fsgc provides a garbage collector for gorilla/sessions FilesystemStore
https://github.com/dchest/gorilla-fsgc

Last synced: about 1 month ago
JSON representation

Package fsgc provides a garbage collector for gorilla/sessions FilesystemStore

Awesome Lists containing this project

README

        

Package fsgc provides a garbage collector for gorilla/session FilesystemStore.

It collects old sessions based on file modification timestamps.

Example:

path := "/path/to/sessions/"
store := sessions.NewFilesystemStore(path, []byte("secret"))
gc := fsgc.New(path).MaxAge(12 * time.Hour).Interval(30 * time.Minute)
gc.Start()
//
// Every 30 minutes gc will remove any sessions files older than 12 hours
// from /path/to/sessions/. When shutting down server, stop the collector.
//
gc.Stop()

PUBLIC DOMAIN DEDICATION

Written in 2015 by Dmitry Chestnykh.

To the extent possible under law, the author have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
http://creativecommons.org/publicdomain/zero/1.0/