Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1,21 @@
|
||||
module sessions
|
||||
|
||||
import time
|
||||
|
||||
pub interface Store[T] {
|
||||
mut:
|
||||
// get the current session data if the id exists and if it's not expired
|
||||
get(sid string, max_age time.Duration) !T
|
||||
// destroy session data for `sid`
|
||||
destroy(sid string) !
|
||||
// set session data for `val`
|
||||
set(sid string, val T) !
|
||||
}
|
||||
|
||||
// get data from all sessions, optional to implement.
|
||||
pub fn (mut s Store[T]) all[T]() ![]T {
|
||||
return []T{}
|
||||
}
|
||||
|
||||
// clear all session data, optional to implement.
|
||||
pub fn (mut s Store[T]) clear[T]() ! {}
|
||||
Reference in new issue
Block a user