web

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStaticFS

func GetStaticFS() fs.FS

GetStaticFS returns the embedded static file system

func GetTemplates

func GetTemplates() (*template.Template, error)

GetTemplates loads and parses embedded HTML templates

func StartWebServer

func StartWebServer(cfg *config.NexusConfig, nexusServer *nexus.Server, logger *zap.Logger) error

StartWebServer starts the HTTP web server

Types

type DashboardData

type DashboardData struct {
	Title        string       `json:"title"`
	Version      string       `json:"version"`
	Uptime       string       `json:"uptime"`
	SystemStatus string       `json:"system_status"`
	MinionCount  int          `json:"minion_count"`
	MinionPort   int          `json:"minion_port"`
	ConsolePort  int          `json:"console_port"`
	WebPort      int          `json:"web_port"`
	Minions      []MinionInfo `json:"minions"`
}

DashboardData represents data for the dashboard template

type DatabaseStatus

type DatabaseStatus struct {
	Status string `json:"status"`
	Host   string `json:"host"`
}

DatabaseStatus represents database connection status

type ErrorResponse

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

ErrorResponse represents an API error response

type HealthResponse

type HealthResponse struct {
	Status    string `json:"status"`
	Timestamp string `json:"timestamp"`
}

HealthResponse represents the API health response

type MinionInfo

type MinionInfo struct {
	ID          string    `json:"id"`
	Status      string    `json:"status"`
	ConnectedAt time.Time `json:"connected_at"`
	LastSeen    time.Time `json:"last_seen"`
}

MinionInfo represents information about a connected minion

type MinionsResponse

type MinionsResponse struct {
	Count   int          `json:"count"`
	Minions []MinionInfo `json:"minions"`
}

MinionsResponse represents the API minions response

type ServerInfo

type ServerInfo struct {
	Port        int    `json:"port"`
	Status      string `json:"status"`
	Connections int    `json:"connections,omitempty"`
}

ServerInfo represents individual server information

type ServerStatusInfo

type ServerStatusInfo struct {
	Minion  ServerInfo `json:"minion"`
	Console ServerInfo `json:"console"`
	Web     ServerInfo `json:"web"`
}

ServerStatusInfo represents server status information

type StatusResponse

type StatusResponse struct {
	Version   string           `json:"version"`
	Uptime    string           `json:"uptime"`
	Timestamp string           `json:"timestamp"`
	Servers   ServerStatusInfo `json:"servers"`
	Database  DatabaseStatus   `json:"database"`
}

StatusResponse represents the API status response

type WebServer

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

WebServer represents the HTTP web server

func NewWebServer

func NewWebServer(cfg *config.NexusConfig, nexusServer *nexus.Server, logger *zap.Logger) (*WebServer, error)

NewWebServer creates a new web server instance

Jump to

Keyboard shortcuts

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