webserver

package
v0.0.0-...-d10a5bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotificationMutex sync.Mutex
)

Functions

func AuthMiddleware

func AuthMiddleware(next http.HandlerFunc) http.HandlerFunc

func DashboardHandler

func DashboardHandler(w http.ResponseWriter, r *http.Request)

func HelpHandler

func HelpHandler(w http.ResponseWriter, _ *http.Request)

func HomeHandler

func HomeHandler(w http.ResponseWriter, _ *http.Request)

func LoginHandler

func LoginHandler(w http.ResponseWriter, r *http.Request)

func LogoutHandler

func LogoutHandler(w http.ResponseWriter, r *http.Request)

func PolicyHandler

func PolicyHandler(w http.ResponseWriter, _ *http.Request)

func ServerCountHandler

func ServerCountHandler(w http.ResponseWriter, _ *http.Request)

func StartAdminDashboard

func StartAdminDashboard() *http.Server

func StartStatsCaching

func StartStatsCaching()

func StatsHandler

func StatsHandler(w http.ResponseWriter, r *http.Request)

func TermsHandler

func TermsHandler(w http.ResponseWriter, _ *http.Request)

Types

type DiscordStats

type DiscordStats struct {
	ServerCount int `json:"server_count"`
}

type HistoricalData

type HistoricalData struct {
	Date  string `json:"date"`
	Value int    `json:"value"`
}

type Stats

type Stats struct {
	TotalAccounts            int
	ActiveAccounts           int
	PermaBannedAccounts      int
	ShadowBannedAccounts     int
	TotalUsers               int
	ChecksLastHour           int
	ChecksLast24Hours        int
	TotalBans                int
	RecentBans               int
	AverageChecksPerDay      float64
	TotalNotifications       int
	RecentNotifications      int
	UsersWithCustomAPIKey    int
	AverageAccountsPerUser   float64
	OldestAccount            time.Time
	NewestAccount            time.Time
	TotalShadowbans          int
	TotalTempbans            int
	BanDates                 []string         `json:"banDates"`
	BanCounts                []int            `json:"banCounts"`
	AccountStatsHistory      []HistoricalData `json:"accountStatsHistory"`
	UserStatsHistory         []HistoricalData `json:"userStatsHistory"`
	CheckStatsHistory        []HistoricalData `json:"checkStatsHistory"`
	BanStatsHistory          []HistoricalData `json:"banStatsHistory"`
	NotificationStatsHistory []HistoricalData `json:"notificationStatsHistory"`
}

func GetCachedStats

func GetCachedStats() Stats

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL