mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
implement session stats, fixes last (admin|user) left at won't work for any provider that removed users after logout.
This commit is contained in:
@@ -52,6 +52,16 @@ type Settings struct {
|
||||
Plugins PluginSettings `json:"plugins"`
|
||||
}
|
||||
|
||||
type Stats struct {
|
||||
HasHost bool `json:"has_host"`
|
||||
HostId string `json:"host_id,omitempty"`
|
||||
ServerStartedAt time.Time `json:"server_started_at"`
|
||||
TotalUsers int `json:"total_users"`
|
||||
LastUserLeftAt *time.Time `json:"last_user_left_at,omitempty"`
|
||||
TotalAdmins int `json:"total_admins"`
|
||||
LastAdminLeftAt *time.Time `json:"last_admin_left_at,omitempty"`
|
||||
}
|
||||
|
||||
type Session interface {
|
||||
ID() string
|
||||
Profile() MemberProfile
|
||||
@@ -110,6 +120,8 @@ type SessionManager interface {
|
||||
Settings() Settings
|
||||
CookieEnabled() bool
|
||||
|
||||
Stats() Stats
|
||||
|
||||
CookieSetToken(w http.ResponseWriter, token string)
|
||||
CookieClearToken(w http.ResponseWriter, r *http.Request)
|
||||
Authenticate(r *http.Request) (Session, error)
|
||||
|
||||
Reference in New Issue
Block a user