server

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamHandler

func StreamHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, h *Hub, minPushInterval time.Duration)

StreamHandler handles a WebSocket /stream connection.

Types

type Client

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

Client represents a connected WebSocket client.

func NewClient

func NewClient(minPushInterval time.Duration) *Client

NewClient creates a new client connection.

type Hub

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

Hub manages all connected clients and broadcasts events.

func NewHub

func NewHub(s *store.Store) *Hub

NewHub creates a new Hub.

func (*Hub) Register

func (h *Hub) Register(c *Client)

Register adds a client to the hub.

func (*Hub) Unregister

func (h *Hub) Unregister(c *Client)

Unregister removes a client from the hub.

type Server

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

Server is the HTTP server for the geospatial data service.

func NewServer

func NewServer(addr string, s *store.Store, minPushInterval time.Duration) *Server

NewServer creates a new HTTP server.

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server.

Jump to

Keyboard shortcuts

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