handler

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

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

AuthHandler handles authentication endpoints.

func NewAuthHandler

func NewAuthHandler(settings *store.SettingsStore, blocklist *store.TokenBlocklistStore) *AuthHandler

NewAuthHandler creates a new AuthHandler.

func (*AuthHandler) ChangePassword

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

ChangePassword handles PUT /api/v1/auth/password

func (*AuthHandler) Login

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

Login handles POST /api/v1/auth/login

func (*AuthHandler) Logout

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

Logout handles POST /api/v1/auth/logout

func (*AuthHandler) Refresh

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

Refresh handles POST /api/v1/auth/refresh

func (*AuthHandler) Setup

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

Setup handles POST /api/v1/auth/setup (no auth, one-time only)

type BackupHandler

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

BackupHandler handles backup endpoints.

func NewBackupHandler

func NewBackupHandler(backups *store.BackupStore) *BackupHandler

NewBackupHandler creates a new BackupHandler.

func (*BackupHandler) Create

func (h *BackupHandler) Create(c *gin.Context)

Create handles POST /api/v1/backups

func (*BackupHandler) Delete

func (h *BackupHandler) Delete(c *gin.Context)

Delete handles DELETE /api/v1/backups/:filename

func (*BackupHandler) Download

func (h *BackupHandler) Download(c *gin.Context)

Download handles GET /api/v1/backups/download/:filename

func (*BackupHandler) List

func (h *BackupHandler) List(c *gin.Context)

List handles GET /api/v1/backups

func (*BackupHandler) Restore

func (h *BackupHandler) Restore(c *gin.Context)

Restore handles POST /api/v1/backups/restore

type BotHandler

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

BotHandler handles Telegram bot endpoints.

func NewBotHandler

func NewBotHandler(settings *store.SettingsStore, deps *bot.Dependencies) *BotHandler

NewBotHandler creates a new BotHandler.

func (*BotHandler) DetectChatID

func (h *BotHandler) DetectChatID(c *gin.Context)

DetectChatID handles GET /api/v1/bot/detect-chat-id

func (*BotHandler) Setup

func (h *BotHandler) Setup(c *gin.Context)

Setup handles POST /api/v1/bot/setup

func (*BotHandler) Status

func (h *BotHandler) Status(c *gin.Context)

Status handles GET /api/v1/bot/status

func (*BotHandler) Test

func (h *BotHandler) Test(c *gin.Context)

Test handles POST /api/v1/bot/test

func (*BotHandler) Toggle

func (h *BotHandler) Toggle(c *gin.Context)

Toggle handles PUT /api/v1/bot/toggle

type ConfigHandler

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

ConfigHandler handles configuration endpoints.

func NewConfigHandler

func NewConfigHandler(settings *store.SettingsStore) *ConfigHandler

NewConfigHandler creates a new ConfigHandler.

func (*ConfigHandler) GetAll

func (h *ConfigHandler) GetAll(c *gin.Context)

GetAll handles GET /api/v1/config

func (*ConfigHandler) GetKey

func (h *ConfigHandler) GetKey(c *gin.Context)

GetKey handles GET /api/v1/config/:key

func (*ConfigHandler) Update

func (h *ConfigHandler) Update(c *gin.Context)

Update handles PUT /api/v1/config

type DockerHandler

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

DockerHandler handles Docker/engine endpoints.

func NewDockerHandler

func NewDockerHandler(docker *dockerutil.DockerClient, dockerSvc *service.DockerService, settings *store.SettingsStore) *DockerHandler

NewDockerHandler creates a new DockerHandler.

func (*DockerHandler) Build

func (h *DockerHandler) Build(c *gin.Context)

Build handles POST /api/v1/engine/build

func (*DockerHandler) EngineStatus

func (h *DockerHandler) EngineStatus(c *gin.Context)

EngineStatus handles GET /api/v1/engine/status

func (*DockerHandler) Install

func (h *DockerHandler) Install(c *gin.Context)

Install handles POST /api/v1/docker/install

func (*DockerHandler) Status

func (h *DockerHandler) Status(c *gin.Context)

Status handles GET /api/v1/docker/status

type GeoblockHandler

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

GeoblockHandler handles geo-blocking endpoints.

func NewGeoblockHandler

func NewGeoblockHandler(settings *store.SettingsStore, geoSvc *service.GeoblockService) *GeoblockHandler

NewGeoblockHandler creates a new GeoblockHandler.

func (*GeoblockHandler) Add

func (h *GeoblockHandler) Add(c *gin.Context)

Add handles POST /api/v1/geoblock/add

func (*GeoblockHandler) Clear

func (h *GeoblockHandler) Clear(c *gin.Context)

Clear handles POST /api/v1/geoblock/clear

func (*GeoblockHandler) Get

func (h *GeoblockHandler) Get(c *gin.Context)

Get handles GET /api/v1/geoblock

func (*GeoblockHandler) Remove

func (h *GeoblockHandler) Remove(c *gin.Context)

Remove handles POST /api/v1/geoblock/remove

func (*GeoblockHandler) SetMode

func (h *GeoblockHandler) SetMode(c *gin.Context)

SetMode handles PUT /api/v1/geoblock/mode

type HealthHandler

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

HealthHandler handles health check endpoint.

func NewHealthHandler

func NewHealthHandler() *HealthHandler

NewHealthHandler creates a new HealthHandler.

func (*HealthHandler) Check

func (h *HealthHandler) Check(c *gin.Context)

Check handles GET /api/v1/health

func (*HealthHandler) SetHealthService

func (h *HealthHandler) SetHealthService(svc *service.HealthService)

SetHealthService sets the health service.

type InstanceHandler

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

InstanceHandler handles instance endpoints.

func NewInstanceHandler

func NewInstanceHandler(instances *store.InstanceStore) *InstanceHandler

NewInstanceHandler creates a new InstanceHandler.

func (*InstanceHandler) Add

func (h *InstanceHandler) Add(c *gin.Context)

Add handles POST /api/v1/instances

func (*InstanceHandler) List

func (h *InstanceHandler) List(c *gin.Context)

List handles GET /api/v1/instances

func (*InstanceHandler) Remove

func (h *InstanceHandler) Remove(c *gin.Context)

Remove handles DELETE /api/v1/instances/:port

type ProxyHandler

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

ProxyHandler handles proxy control endpoints.

func NewProxyHandler

func NewProxyHandler(container *service.ContainerService, secrets *store.SecretStore, settings *store.SettingsStore) *ProxyHandler

NewProxyHandler creates a new ProxyHandler.

func (*ProxyHandler) Logs

func (h *ProxyHandler) Logs(c *gin.Context)

Logs handles GET /api/v1/proxy/logs (supports SSE when follow=true)

func (*ProxyHandler) Reload

func (h *ProxyHandler) Reload(c *gin.Context)

Reload handles POST /api/v1/proxy/reload

func (*ProxyHandler) Restart

func (h *ProxyHandler) Restart(c *gin.Context)

Restart handles POST /api/v1/proxy/restart

func (*ProxyHandler) SetDockerClient

func (h *ProxyHandler) SetDockerClient(d *dockerutil.DockerClient)

SetDockerClient sets the Docker client for log streaming.

func (*ProxyHandler) Start

func (h *ProxyHandler) Start(c *gin.Context)

Start handles POST /api/v1/proxy/start

func (*ProxyHandler) Status

func (h *ProxyHandler) Status(c *gin.Context)

Status handles GET /api/v1/proxy/status

func (*ProxyHandler) Stop

func (h *ProxyHandler) Stop(c *gin.Context)

Stop handles POST /api/v1/proxy/stop

type ReplicationHandler

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

ReplicationHandler handles replication endpoints.

func NewReplicationHandler

func NewReplicationHandler(settings *store.SettingsStore, slaves *store.SlaveStore) *ReplicationHandler

NewReplicationHandler creates a new ReplicationHandler.

func (*ReplicationHandler) AddSlave

func (h *ReplicationHandler) AddSlave(c *gin.Context)

AddSlave handles POST /api/v1/replication/slaves

func (*ReplicationHandler) ListSlaves

func (h *ReplicationHandler) ListSlaves(c *gin.Context)

ListSlaves handles GET /api/v1/replication/slaves

func (*ReplicationHandler) RemoveSlave

func (h *ReplicationHandler) RemoveSlave(c *gin.Context)

RemoveSlave handles DELETE /api/v1/replication/slaves/:host

func (*ReplicationHandler) SSHKeygen

func (h *ReplicationHandler) SSHKeygen(c *gin.Context)

SSHKeygen handles POST /api/v1/replication/ssh-keygen

func (*ReplicationHandler) SetReplicationService

func (h *ReplicationHandler) SetReplicationService(svc *service.ReplicationService)

SetReplicationService sets the replication service.

func (*ReplicationHandler) Setup

func (h *ReplicationHandler) Setup(c *gin.Context)

Setup handles POST /api/v1/replication/setup

func (*ReplicationHandler) Status

func (h *ReplicationHandler) Status(c *gin.Context)

Status handles GET /api/v1/replication/status

func (*ReplicationHandler) Sync

func (h *ReplicationHandler) Sync(c *gin.Context)

Sync handles POST /api/v1/replication/sync

func (*ReplicationHandler) Test

func (h *ReplicationHandler) Test(c *gin.Context)

Test handles POST /api/v1/replication/test

type SecretHandler

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

SecretHandler handles secret endpoints.

func NewSecretHandler

func NewSecretHandler(secrets *service.SecretService, settings *store.SettingsStore) *SecretHandler

NewSecretHandler creates a new SecretHandler.

func (*SecretHandler) Add

func (h *SecretHandler) Add(c *gin.Context)

Add handles POST /api/v1/secrets

func (*SecretHandler) Get

func (h *SecretHandler) Get(c *gin.Context)

Get handles GET /api/v1/secrets/:label

func (*SecretHandler) GetLimits

func (h *SecretHandler) GetLimits(c *gin.Context)

GetLimits handles GET /api/v1/secrets/:label/limits

func (h *SecretHandler) GetLink(c *gin.Context)

GetLink handles GET /api/v1/secrets/:label/link

func (*SecretHandler) GetQR

func (h *SecretHandler) GetQR(c *gin.Context)

GetQR handles GET /api/v1/secrets/:label/qr Returns a PNG image of the QR code for the proxy link. Optional query param: ?size=512 (default 256)

func (*SecretHandler) List

func (h *SecretHandler) List(c *gin.Context)

List handles GET /api/v1/secrets

func (*SecretHandler) Remove

func (h *SecretHandler) Remove(c *gin.Context)

Remove handles DELETE /api/v1/secrets/:label

func (*SecretHandler) ResetAllTraffic

func (h *SecretHandler) ResetAllTraffic(c *gin.Context)

ResetAllTraffic handles POST /api/v1/secrets/reset-traffic

func (*SecretHandler) ResetTraffic

func (h *SecretHandler) ResetTraffic(c *gin.Context)

ResetTraffic handles POST /api/v1/secrets/:label/reset-traffic

func (*SecretHandler) Rotate

func (h *SecretHandler) Rotate(c *gin.Context)

Rotate handles POST /api/v1/secrets/:label/rotate

func (*SecretHandler) SetLimits

func (h *SecretHandler) SetLimits(c *gin.Context)

SetLimits handles PUT /api/v1/secrets/:label/limits

func (*SecretHandler) Toggle

func (h *SecretHandler) Toggle(c *gin.Context)

Toggle handles PUT /api/v1/secrets/:label/toggle

func (*SecretHandler) UpdateNotes

func (h *SecretHandler) UpdateNotes(c *gin.Context)

UpdateNotes handles PUT /api/v1/secrets/:label/notes

type SystemHandler

type SystemHandler struct{}

SystemHandler handles system-level endpoints.

func NewSystemHandler

func NewSystemHandler() *SystemHandler

NewSystemHandler creates a new SystemHandler.

func (*SystemHandler) GetOS

func (h *SystemHandler) GetOS(c *gin.Context)

GetOS handles GET /api/v1/system/os

func (*SystemHandler) InstallService

func (h *SystemHandler) InstallService(c *gin.Context)

InstallService handles POST /api/v1/system/service/install

func (*SystemHandler) ReloadService

func (h *SystemHandler) ReloadService(c *gin.Context)

ReloadService handles POST /api/v1/system/service/reload

func (*SystemHandler) RestartService

func (h *SystemHandler) RestartService(c *gin.Context)

RestartService handles POST /api/v1/system/service/restart

func (*SystemHandler) ServiceStatus

func (h *SystemHandler) ServiceStatus(c *gin.Context)

ServiceStatus handles GET /api/v1/system/service/status

func (*SystemHandler) UninstallService

func (h *SystemHandler) UninstallService(c *gin.Context)

UninstallService handles DELETE /api/v1/system/service/uninstall

type TrafficHandler

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

TrafficHandler handles traffic monitoring endpoints.

func NewTrafficHandler

func NewTrafficHandler(traffic *store.TrafficStore, settings *store.SettingsStore) *TrafficHandler

NewTrafficHandler creates a new TrafficHandler.

func (*TrafficHandler) Get

func (h *TrafficHandler) Get(c *gin.Context)

Get handles GET /api/v1/traffic

func (*TrafficHandler) GetLive

func (h *TrafficHandler) GetLive(c *gin.Context)

GetLive handles GET /api/v1/traffic/live

func (*TrafficHandler) GetUser

func (h *TrafficHandler) GetUser(c *gin.Context)

GetUser handles GET /api/v1/traffic/:label

func (*TrafficHandler) SetTrafficService

func (h *TrafficHandler) SetTrafficService(svc *service.TrafficService)

SetTrafficService sets the traffic service for live metrics.

type UpdateHandler

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

UpdateHandler handles auto-update endpoints.

func NewUpdateHandler

func NewUpdateHandler(svc *service.UpdateService) *UpdateHandler

NewUpdateHandler creates a new UpdateHandler.

func (*UpdateHandler) Apply

func (h *UpdateHandler) Apply(c *gin.Context)

Apply handles POST /api/v1/update/apply Downloads and installs the update, then triggers a restart in a goroutine after the response is sent.

func (*UpdateHandler) Check

func (h *UpdateHandler) Check(c *gin.Context)

Check handles GET /api/v1/update/check

type UpstreamHandler

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

UpstreamHandler handles upstream endpoints.

func NewUpstreamHandler

func NewUpstreamHandler(upstreams *service.UpstreamService) *UpstreamHandler

NewUpstreamHandler creates a new UpstreamHandler.

func (*UpstreamHandler) Add

func (h *UpstreamHandler) Add(c *gin.Context)

Add handles POST /api/v1/upstreams

func (*UpstreamHandler) List

func (h *UpstreamHandler) List(c *gin.Context)

List handles GET /api/v1/upstreams

func (*UpstreamHandler) Remove

func (h *UpstreamHandler) Remove(c *gin.Context)

Remove handles DELETE /api/v1/upstreams/:name

func (*UpstreamHandler) Test

func (h *UpstreamHandler) Test(c *gin.Context)

Test handles POST /api/v1/upstreams/:name/test

func (*UpstreamHandler) Toggle

func (h *UpstreamHandler) Toggle(c *gin.Context)

Toggle handles PUT /api/v1/upstreams/:name/toggle

type WSHandler

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

WSHandler handles WebSocket live metrics streaming.

func NewWSHandler

func NewWSHandler(traffic *service.TrafficService) *WSHandler

NewWSHandler creates a new WSHandler.

func (*WSHandler) Handle

func (h *WSHandler) Handle(c *gin.Context)

Handle upgrades to WebSocket and streams live metrics every 2 seconds.

Jump to

Keyboard shortcuts

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