web

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSEBroker

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

SSEBroker manages Server-Sent Events for live reload.

func NewSSEBroker

func NewSSEBroker() *SSEBroker

NewSSEBroker creates a new SSE event broker.

func (*SSEBroker) Notify

func (b *SSEBroker) Notify(path string)

Notify sends a reload event to all connected clients.

func (*SSEBroker) Stop

func (b *SSEBroker) Stop()

Stop shuts down the broker and closes all client connections.

type Server

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

Server is the HTTP server for web mode.

func New

func New(cfg *config.Config, idx index.Indexer, links *index.LinkGraph, plugins *plugin.Registry) *Server

New creates a new web server.

func (*Server) OnFileChange

func (s *Server) OnFileChange(relPath string)

OnFileChange is a callback for the file watcher. Wire it to index.Watcher's onChange.

func (*Server) Start

func (s *Server) Start() error

Start begins listening on the configured port and handles graceful shutdown.

func (*Server) Stop

func (s *Server) Stop() error

Stop gracefully shuts down the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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