Documentation ¶
Index ¶
Constants ¶
const (
DefaultPort = lrserver.DefaultPort
)
emoji's used in logg messages for at a glance changes.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(livereloadPort uint16, paths []string, mappings ReloadMapping) (done chan struct{}, err error)
ListenAndServe sets up an asset livereload monitor and notification instance. default livereload port is 35729.
if you wish to stop the listener just close the returned 'done' channel
Types ¶
type PreReloadFunc ¶
PreReloadFunc is the reload function, mapped to a given extension just in case you wish to do something before notifying the browser/listener of the change. reload indicates if the reload notification should proceed eg. PreReloadFunc may just compile .sass to .css so no need to notify for the .sass conversion because the .css change will be caught and will trigger the notify.
type ReloadMapping ¶
type ReloadMapping map[string]PreReloadFunc
ReloadMapping is a map of file extensions to their PreReloadFunc's. PreReloadFunc mapping can be nil if nor function needs to be run.