feat(session): add session management utility
This commit is contained in:
20
unstable/session/types.go
Normal file
20
unstable/session/types.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package Session
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const Session_Lifetime time.Duration = time.Duration(120) * time.Second
|
||||
const cookie_key string = "GSESSID"
|
||||
|
||||
type session struct {
|
||||
mtx sync.Mutex
|
||||
data map[string]any
|
||||
expiry time.Time
|
||||
}
|
||||
|
||||
type sessionManager struct {
|
||||
sessions map[string]*session
|
||||
mtx sync.Mutex
|
||||
}
|
||||
Reference in New Issue
Block a user