Documentation
¶
Index ¶
Constants ¶
View Source
const Snippet = `` /* 227-byte string literal not displayed */
Snippet is a minimal javascript client for reloading browse Embed in your `index.html` using a script tag: <script>{{ LiveReload.Snippet }}</script>
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LiveReload ¶
type LiveReload struct {
// contains filtered or unexported fields
}
LiveReload keeps track of connected browser clients and broadcasts messages to those connected browser clients.
func (LiveReload) SendEvent ¶
func (livereload LiveReload) SendEvent(res http.ResponseWriter, eventData string)
SendEvent is helper to create formatted SSE events based on event type and data.
func (*LiveReload) ServeHTTP ¶
func (livereload *LiveReload) ServeHTTP(res http.ResponseWriter, req *http.Request)
ServeHTTP handler for `/livereload` urls
func (*LiveReload) Start ¶
func (livereload *LiveReload) Start()
Start manages connections and broadcasts messages to current connected browser clients
Click to show internal directories.
Click to hide internal directories.