Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileName ¶
GetFileName returns the filename from a path Example: "theme/index.html" -> "index.html"
Types ¶
type DevWatch ¶
type DevWatch struct {
*WatchConfig
// contains filtered or unexported fields
}
func New ¶
func New(c *WatchConfig) *DevWatch
func (*DevWatch) AddSupportedAssetsExtensions ¶ added in v0.0.3
AddSupportedAssetsExtensions adds one or more file extensions to the supported assets list. By default, the following extensions are included: .html, .css, .js, .svg It ensures no duplicates are added. Example: dw.AddSupportedAssetsExtensions(".png", ".jpg")
func (*DevWatch) FileWatcherStart ¶
func (*DevWatch) InitialRegistration ¶
func (h *DevWatch) InitialRegistration()
type FolderEvent ¶
event: create, remove, write, rename
type GoFileHandler ¶ added in v0.0.3
type GoFileHandler interface {
godepfind.DepHandler
FileEvent
}
type WatchConfig ¶
type WatchConfig struct {
AppRootDir string // eg: "home/user/myNewApp"
FileEventAssets FileEvent // when change assets files eg: css, js, html, png, jpg, svg, etc event: create, remove, write, rename
FilesEventGO []GoFileHandler // handlers for go file events (backend, wasm, etc)
FolderEvents FolderEvent // when directories are created/removed for architecture detection
BrowserReload func() error // when change frontend files reload browser
Writer io.Writer // For logging output
ExitChan chan bool // global channel to signal the exit
UnobservedFiles func() []string // files that are not observed by the watcher eg: ".git", ".gitignore", ".vscode", "examples",
}
Click to show internal directories.
Click to hide internal directories.