Documentation
¶
Overview ¶
Package server provides the HTTP server and WebSocket handler for the web interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpgradeConnection ¶
UpgradeConnection upgrades an HTTP connection to WebSocket.
Types ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler processes WebSocket commands.
func NewCommandHandler ¶
func NewCommandHandler( cfg *config.Config, getState func() types.EncoderState, startOutput func(string) error, stopOutput func(string) error, restartEnc func() error, testTriggers map[string]func() error, ) *CommandHandler
NewCommandHandler creates a new command handler.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager handles user authentication sessions.
func NewSessionManager ¶
func NewSessionManager() *SessionManager
NewSessionManager creates a new session manager.
func (*SessionManager) AuthMiddleware ¶
func (sm *SessionManager) AuthMiddleware(username, password string) func(http.HandlerFunc) http.HandlerFunc
AuthMiddleware returns middleware that requires HTTP Basic Authentication or a valid session cookie.
func (*SessionManager) Create ¶
func (sm *SessionManager) Create() string
Create creates a new session and returns the token.
func (*SessionManager) Validate ¶
func (sm *SessionManager) Validate(token string) bool
Validate checks if a session token is valid.
Click to show internal directories.
Click to hide internal directories.