Documentation
¶
Overview ¶
Package cmd contains the commands for the winter CLI.
Index ¶
Constants ¶
const (
KnownURLsPath = "src/urls.txt"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
Builder is a function that builds a source file src into a destination directory dst.
type Reloader ¶
type Reloader struct { // Builders is a mapping of filepath patterns to functions which can build // paths that match those patterns. Deprecated: Use Substructure instead. Builders map[string]Builder Ignore map[string]struct{} Substructure *document.Substructure // contains filtered or unexported fields }
Reloader watches the filesystem for changes to relevant files so it can reload the browser using WebSockets.
func (*Reloader) Handler ¶
Handler returns a function that handles incoming WebSocket connections which implements http.Handler.
func (*Reloader) Reload ¶
func (r *Reloader) Reload()
Reload notifies all connected browsers to reload the page. It also notifies any browsers that connect in the next second,
func (*Reloader) Shutdown ¶
func (r *Reloader) Shutdown()
Shutdown stops watching the filesystem for changes and gracefully closes any open WebSocket connections.
func (*Reloader) Watch ¶
Watch starts watching the filesystem for changes asynchronously, building any changes based on the contents of Builders and then reloading any connected browser.
Watch returns once the goroutine has been spun off successfully. Any errors enountered while watching the filesystem are printed to stderr.