Documentation
¶
Overview ¶
Package devserver implements tryck dev: it builds the site into memory, serves it, rebuilds on file changes and tells browsers to reload over a WebSocket.
Each build produces an immutable build.Site. Requests read the current one from an atomic pointer and a single builder goroutine swaps it, so the request path takes no locks and never sees a half-built site.
Index ¶
Constants ¶
const DefaultDebounce = 75 * time.Millisecond
DefaultDebounce is how long the builder waits for file events to settle.
const WSPath = "/__tryck/ws"
WSPath is where browsers connect for reload and error messages.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
ConfigPath string // config file to reload on change
ConfigExplicit bool // --config was given, so the file must exist
Overrides config.Overrides // applied after every config load
Out io.Writer // diagnostics and status lines
Logger *slog.Logger // debug logging; nil = silent
Verbose bool // also print info diagnostics
Debounce time.Duration // 0 = DefaultDebounce
Plugins []plugin.Plugin // extra compiled-in plugins
}
Options configure a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the dev server. Create it with New, call Start, and serve Handler.