server

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandlerMiddleware added in v0.3.0

func ErrorHandlerMiddleware() gin.HandlerFunc

ErrorHandlerMiddleware handles errors set by handlers and returns proper JSON responses

func LoggerMiddleware

func LoggerMiddleware() gin.HandlerFunc

func RequireAuth added in v0.1.0

func RequireAuth(db database.Service, oidc *auth.OIDCConfig, sessionSecret string, handler *AuthHandler, whitelist []string) gin.HandlerFunc

Types

type AuthHandler

type AuthHandler struct {
	// contains filtered or unexported fields
}

func NewAuthHandler

func NewAuthHandler(db database.Service, oidc *auth.OIDCConfig, sessionSecret string, whitelist []string) *AuthHandler

func (*AuthHandler) CheckRegistrationStatus

func (h *AuthHandler) CheckRegistrationStatus(c *gin.Context)

func (*AuthHandler) GetUserInfo

func (h *AuthHandler) GetUserInfo(c *gin.Context)

func (*AuthHandler) InitOIDCRoutes added in v0.1.0

func (h *AuthHandler) InitOIDCRoutes(r *gin.RouterGroup)

func (*AuthHandler) Login

func (h *AuthHandler) Login(c *gin.Context)

func (*AuthHandler) Logout

func (h *AuthHandler) Logout(c *gin.Context)

func (*AuthHandler) Register

func (h *AuthHandler) Register(c *gin.Context)

func (*AuthHandler) Verify

func (h *AuthHandler) Verify(c *gin.Context)

type ErrorResponse added in v0.3.0

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

ErrorResponse represents the structure of error responses

type Server

type Server struct {
	Router *gin.Engine
	// contains filtered or unexported fields
}

func NewServer

func NewServer(speedtest speedtest.Service, db database.Service, scheduler scheduler.Service, cfg *config.Config, packetLossService *speedtest.PacketLossService, monitorService *monitor.Service, notifier *notifications.Notifier) *Server

func (*Server) BroadcastMonitorUpdate added in v0.4.0

func (s *Server) BroadcastMonitorUpdate(update types.MonitorUpdate)

func (*Server) BroadcastPacketLossUpdate added in v0.4.0

func (s *Server) BroadcastPacketLossUpdate(update types.PacketLossUpdate)

func (*Server) BroadcastTracerouteUpdate added in v0.3.0

func (s *Server) BroadcastTracerouteUpdate(update types.TracerouteUpdate)

func (*Server) BroadcastUpdate

func (s *Server) BroadcastUpdate(update types.SpeedUpdate)

func (*Server) Initialize added in v0.4.0

func (s *Server) Initialize()

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes()

func (*Server) SetMonitorService added in v0.4.0

func (s *Server) SetMonitorService(service *monitor.Service)

func (*Server) SetPacketLossService added in v0.4.0

func (s *Server) SetPacketLossService(service *speedtest.PacketLossService)

func (*Server) StartScheduler added in v0.1.0

func (s *Server) StartScheduler(ctx context.Context)

type SessionClaims added in v0.10.0

type SessionClaims struct {
	Version      int    `json:"v"`
	Type         string `json:"type"`
	Username     string `json:"username,omitempty"`
	Subject      string `json:"sub,omitempty"`
	IDTokenExp   int64  `json:"id_exp,omitempty"`
	RefreshToken string `json:"rt,omitempty"`
	LastRefresh  int64  `json:"lrt,omitempty"`
}

Jump to

Keyboard shortcuts

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