Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/dchest/gorilla-fsgc
- Owner: dchest
- Created: 2015-03-29T18:09:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-09T11:20:55.000Z (over 9 years ago)
- Last Synced: 2024-04-15T01:16:08.350Z (7 months ago)
- Language: Go
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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/