Categorygithub.com/ugo-framework/ugo-spectator
repository
0.0.0-20200723103328-ee4f6dbe3032
Repository: https://github.com/ugo-framework/ugo-spectator.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

ugo spectator logo

Ugo Spectator

The only file watcher you will ever need written in go (Golang).

Installation

go get github.com/ugo-framework/ugo-spectator

Then use it in your code use the following sysntax

package examples

import spectator "github.com/ugo-framework/ugo-spectator/lib"

func main() {
	// initialise the spectator with the dirname
	watcher, err := spectator.Init(".")
	if err != nil {
		// Handle Error
	}
	defer watcher.Close() // handle error
	// event to catch for file change
	for {
		select {
		case res := <-watcher.Ch:
			// Do Something
		}
	}
}

The full example can be viewed here This documentation is not Complete and still in its early stages