server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package server provides HTTP server for theme rendering with WebSocket sensor data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server serves theme files and streams sensor data via WebSocket.

func New

func New(distDir string) *Server

New creates a new theme server.

func (*Server) BroadcastSensorData

func (s *Server) BroadcastSensorData(data interface{}) error

BroadcastSensorData sends sensor data to all connected WebSocket clients.

func (*Server) ClientCount

func (s *Server) ClientCount() int

ClientCount returns the number of connected WebSocket clients.

func (*Server) Port

func (s *Server) Port() int

Port returns the port the server is listening on.

func (*Server) Start

func (s *Server) Start() error

Start starts the server on a random available port.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server.

func (*Server) URL

func (s *Server) URL() string

URL returns the base URL of the server.

Jump to

Keyboard shortcuts

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