Initial project import

This commit is contained in:
Agila Forge Importer committed 2026-07-13 15:20:32 +00:00
commit 23f2d29e32
11957 files changed
+1754577

No files matched your search

+21
View File
@@ -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]() ! {}