watch

package
v0.0.0-...-2fb2b97 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package watch provides a file watcher that serves DOT graphs as SVG via HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	File   string    // DOT file to serve
	Port   string    // HTTP server port (use "0" for a random available port)
	Debug  bool      // enable debug logging
	Stdout io.Writer // output for status messages
	Stderr io.Writer // output for error logging
}

Config configures a Watcher.

type Watcher

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

Watcher watches a DOT file for changes and serves the rendered SVG via HTTP. It provides an SSE endpoint that notifies connected browsers when the file changes.

func New

func New(cfg Config) (*Watcher, error)

New creates a Watcher that serves the given DOT file as SVG on the specified port.

func (*Watcher) Watch

func (wa *Watcher) Watch(ctx context.Context) error

Watch starts the HTTP server and blocks until the context is cancelled.

Jump to

Keyboard shortcuts

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