Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides functionality to serve Starlark over HTTP. It has functionality to watch a file and hot reload the browser on changes.
type Watcher ¶ added in v0.32.0
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is a structure to watch a file for changes and notify a channel.
func NewWatcher ¶ added in v0.32.0
NewWatcher instantiates a new watcher with the provided filename and changes channel.
func (*Watcher) Run ¶ added in v0.32.0
Run starts the file watcher in a blocking fashion. This watches an entire directory and only notifies the channel when the specified file is changed. If there is an error, it's returned. It's up to the caller to respawn the watcher if it's desireable to keep watching.
The reason it watches a directory is becausde some editers like VIM write to a swap file and recreate the original file. So we can't simply watch the original file, we have to watch the directory. This is also why we check both the WRITE and CREATE events since VIM will write to a swap and then create the file on save. VSCode does a WRITE and then a CHMOD, so tracking WRITE catches the changes for VSCode exactly once.
Directories ¶
Path | Synopsis |
---|---|
Package browser provides the ability to send WebP images to a browser over websockets.
|
Package browser provides the ability to send WebP images to a browser over websockets. |
Package loader provides primitives to load an applet both when the underlying file changes and on demand when an update is requested.
|
Package loader provides primitives to load an applet both when the underlying file changes and on demand when an update is requested. |