Archived
2
0

add fields to stats.

This commit is contained in:
Miroslav Šedivý
2021-11-17 22:10:55 +01:00
parent 6d7486ab57
commit f59128cf72
5 changed files with 70 additions and 18 deletions

View File

@ -1,11 +1,23 @@
package types
import "net/http"
import (
"net/http"
"time"
)
type Stats struct {
Connections uint32 `json:"connections"`
Host string `json:"host"`
Members []*Member `json:"members"`
Banned map[string]string `json:"banned"` // IP -> session ID (that banned it)
Locked map[string]string `json:"locked"` // resource name -> session ID (that locked it)
ServerStartedAt time.Time `json:"server_started_at"`
LastAdminLeftAt *time.Time `json:"last_admin_left_at"`
LastUserLeftAt *time.Time `json:"last_user_left_at"`
ControlProtection bool `json:"control_protection"`
}
type WebSocket interface {