Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(jwtSecret string, blocklist BlocklistChecker) gin.HandlerFunc
AuthMiddleware validates JWT tokens on protected routes.
func CORSMiddleware ¶
func CORSMiddleware(allowedOrigins []string) gin.HandlerFunc
CORSMiddleware configures CORS for the Vue frontend.
func SetupRouter ¶
func SetupRouter(cfg RouterConfig) *gin.Engine
SetupRouter creates and configures the Gin router.
Types ¶
type BlocklistChecker ¶
BlocklistChecker checks if a JWT token ID is revoked.
type RouterConfig ¶
type RouterConfig struct {
Debug bool
JWTSecret string
Settings *store.SettingsStore
Secrets *store.SecretStore
Upstreams *store.UpstreamStore
Instances *store.InstanceStore
Slaves *store.SlaveStore
Traffic *store.TrafficStore
Blocklist *store.TokenBlocklistStore
Backups *store.BackupStore
Docker *dockerutil.DockerClient
// Services
SecretSvc *service.SecretService
UpstreamSvc *service.UpstreamService
ContainerSvc *service.ContainerService
DockerSvc *service.DockerService
GeoblockSvc *service.GeoblockService
BotDeps *bot.Dependencies
HealthSvc *service.HealthService
TrafficSvc *service.TrafficService
ReplSvc *service.ReplicationService
UpdateSvc *service.UpdateService
}
RouterConfig holds dependencies for router setup.
Click to show internal directories.
Click to hide internal directories.