controller

package
v2.8.9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package controller provides HTTP request handlers and controllers for the 3x-ui web management panel. It handles routing, authentication, and API endpoints for managing Xray inbounds, settings, and more.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func I18nWeb

func I18nWeb(c *gin.Context, name string, params ...string) string

I18nWeb retrieves an internationalized message for the web interface based on the current locale.

Types

type APIController

type APIController struct {
	BaseController

	Tgbot service.Tgbot
	// contains filtered or unexported fields
}

APIController handles the main API routes for the 3x-ui panel, including inbounds and server management.

func NewAPIController

func NewAPIController(g *gin.RouterGroup) *APIController

NewAPIController creates a new APIController instance and initializes its routes.

func (*APIController) BackuptoTgbot

func (a *APIController) BackuptoTgbot(c *gin.Context)

BackuptoTgbot sends a backup of the panel data to Telegram bot admins.

type BaseController

type BaseController struct{}

BaseController provides common functionality for all controllers, including authentication checks.

type InboundController

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

InboundController handles HTTP requests related to Xray inbounds management.

func NewInboundController

func NewInboundController(g *gin.RouterGroup) *InboundController

NewInboundController creates a new InboundController and sets up its routes.

type IndexController

type IndexController struct {
	BaseController
	// contains filtered or unexported fields
}

IndexController handles the main index and login-related routes.

func NewIndexController

func NewIndexController(g *gin.RouterGroup) *IndexController

NewIndexController creates a new IndexController and initializes its routes.

type LoginForm

type LoginForm struct {
	Username      string `json:"username" form:"username"`
	Password      string `json:"password" form:"password"`
	TwoFactorCode string `json:"twoFactorCode" form:"twoFactorCode"`
}

LoginForm represents the login request structure.

type ServerController

type ServerController struct {
	BaseController
	// contains filtered or unexported fields
}

ServerController handles server management and status-related operations.

func NewServerController

func NewServerController(g *gin.RouterGroup) *ServerController

NewServerController creates a new ServerController, initializes routes, and starts background tasks.

type SettingController

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

SettingController handles settings and user management operations.

func NewSettingController

func NewSettingController(g *gin.RouterGroup) *SettingController

NewSettingController creates a new SettingController and initializes its routes.

type WebSocketController

type WebSocketController struct {
	BaseController
	// contains filtered or unexported fields
}

WebSocketController handles WebSocket connections for real-time updates

func NewWebSocketController

func NewWebSocketController(hub *websocket.Hub) *WebSocketController

NewWebSocketController creates a new WebSocket controller

func (*WebSocketController) HandleWebSocket

func (w *WebSocketController) HandleWebSocket(c *gin.Context)

HandleWebSocket handles WebSocket connections

type XUIController

type XUIController struct {
	BaseController
	// contains filtered or unexported fields
}

XUIController is the main controller for the X-UI panel, managing sub-controllers.

func NewXUIController

func NewXUIController(g *gin.RouterGroup) *XUIController

NewXUIController creates a new XUIController and initializes its routes.

type XraySettingController

type XraySettingController struct {
	XraySettingService service.XraySettingService
	SettingService     service.SettingService
	InboundService     service.InboundService
	OutboundService    service.OutboundService
	XrayService        service.XrayService
	WarpService        service.WarpService
}

XraySettingController handles Xray configuration and settings operations.

func NewXraySettingController

func NewXraySettingController(g *gin.RouterGroup) *XraySettingController

NewXraySettingController creates a new XraySettingController and initializes its routes.

Jump to

Keyboard shortcuts

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